Typed library problems, client problems.

Typed library problems, client problems.

Post by Seldo » Wed, 22 May 2002 05:32:59



Hello,

        Im new in COM development.

So, I have some problems with Typed library, my client seems unable to
import my DLL.

There is my IDL file:

===============================================
// dIOAudio.idl : IDL source for dIOAudio.dll
//

// This file will be processed by the MIDL tool to
// produce the type library (dIOAudio.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";
import "unknwn.idl";

[ object, uuid(F0016696-EF27-4FC0-8D93-EE7009F4BDB9) ]

//
//
Conversion de HINSTANCE a HWND pour que le type soit support par MIDL?
//

interface IIOAudio : IUnknown
{
        HRESULT ShowOpenFileDialog([in] HWND hWnd,[in] HWND hInstance,[out]
TCHAR* szFile,[in] DWORD dwFlags,[in] LPCTSTR lpstrFilter,[in] LPCTSTR
lpstrDefExt);

Quote:}

[
        uuid(F0016697-EF27-4FC0-8D93-EE7009F4BDB9),
        version(1.0),
        helpstring("dIOAudio 1.0 Type Library")
]
library DIOAUDIOLib
{
        importlib("stdole32.tlb");
        importlib("stdole2.tlb");

        interface IIOAudio;

     [ uuid(F0016698-EF27-4FC0-8D93-EE7009F4BDB9) ]
     coclass CCManager
     {
         interface IIOAudio;
     }

Quote:};

===============================================

So, I think that everything is okay there.

After, to call my interface, my client will use this code:

===============================================
#define _WIN32_DCOM
#import "c:\program files\microsoft visual
studio\myprojects\tinnymp3\dioaudio\debug\dioaudio.dll" no_namespace

...

CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
pIOAudio myRef(__uuidof(CCManager));
myRef->ShowOpenFileDialog(hDlg,(HWND)cWindow.hInst,ptszFileName);
                                        myRef = NULL;
                                        CoUninitialize();
...

===============================================

The problem is that when I compile my client application, he is not able
to find CCManager. This tell me that he can't #import the IIOAudio
interface from dioaudio.dll?

Note, my dll is registered....

Thank for your help,

Salutations,

Fred

 
 
 

Typed library problems, client problems.

Post by John Dudd » Wed, 22 May 2002 08:44:43


Perhaps you need the named_guids argument to #import?

JD

Quote:> Hello,

> Im new in COM development.

> So, I have some problems with Typed library, my client seems unable to
> import my DLL.

> There is my IDL file:

> ===============================================
> // dIOAudio.idl : IDL source for dIOAudio.dll
> //

> // This file will be processed by the MIDL tool to
> // produce the type library (dIOAudio.tlb) and marshalling code.

> import "oaidl.idl";
> import "ocidl.idl";
> import "unknwn.idl";

> [ object, uuid(F0016696-EF27-4FC0-8D93-EE7009F4BDB9) ]

> //
> //
> Conversion de HINSTANCE a HWND pour que le type soit support par MIDL?
> //

> interface IIOAudio : IUnknown
> {
> HRESULT ShowOpenFileDialog([in] HWND hWnd,[in] HWND hInstance,[out]
> TCHAR* szFile,[in] DWORD dwFlags,[in] LPCTSTR lpstrFilter,[in] LPCTSTR
> lpstrDefExt);
> }

> [
> uuid(F0016697-EF27-4FC0-8D93-EE7009F4BDB9),
> version(1.0),
> helpstring("dIOAudio 1.0 Type Library")
> ]
> library DIOAUDIOLib
> {
> importlib("stdole32.tlb");
> importlib("stdole2.tlb");

> interface IIOAudio;

>      [ uuid(F0016698-EF27-4FC0-8D93-EE7009F4BDB9) ]
>      coclass CCManager
>      {
>          interface IIOAudio;
>      }

> };

> ===============================================

> So, I think that everything is okay there.

> After, to call my interface, my client will use this code:

> ===============================================
> #define _WIN32_DCOM
> #import "c:\program files\microsoft visual
> studio\myprojects\tinnymp3\dioaudio\debug\dioaudio.dll" no_namespace

> ...

> CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
> pIOAudio myRef(__uuidof(CCManager));
> myRef->ShowOpenFileDialog(hDlg,(HWND)cWindow.hInst,ptszFileName);
> myRef = NULL;
> CoUninitialize();
> ...

> ===============================================

> The problem is that when I compile my client application, he is not able
> to find CCManager. This tell me that he can't #import the IIOAudio
> interface from dioaudio.dll?

> Note, my dll is registered....

> Thank for your help,

> Salutations,

> Fred


 
 
 

Typed library problems, client problems.

Post by Seldo » Thu, 23 May 2002 02:35:32


Hello,

         Everything was okay in my code, the problem wasn't there. My
project in Visual Studio was corrupted in some ways and I was unable to
#import my COM interface ( the compiler seem skipped the instruction ).
So, I deleted my project and I remake another and everything work fine.

Thank for your help,

Salutations,

Fred

 
 
 

1. Ramifications of Old Type Libraries vs. New Type Libraries

Our application is still heavily used on Win32s. We are under the
impression that if a Type Library is built with the NT4 OLEAUT32.DLL the
resulting Type Library does not work properly on Win32s. We believe that
we have even seen this for a fact since some problems on Win32s appeared
when we upgraded our developers to NT4, and they went away when we added
the /old switch to MIDL 3.00.44.

We have run into a snag however. MIDL 3.01.75 does not appear to be able
to handle the /old (now called /oldtlb) switch properly (see another
post here), and our Type Library seems to have grown too large for MIDL
3.00.44 (it crashes if we add a couple more methods to the last
interface in the file).

We are at a loss as to what to do now, since we have a number things
that need to be added to the Type Library. We cannot give up OLE
Automation support on Win32s.

Can anybody give me a rundown of what the real differences between /old
and /new Type Libraries are, and what support files are required to read
the new Type Libraries? I have heard rumour that oleaut32.dll has to be
upgraded on Windows 95 - is this true? Is this information explained
anywhere besides MSDN?

Thanks for any help
Rob Eastick
Hyprotech Ltd.

2. VOLUME DATA VANISHING OF THE EARTH

3. Type Library problem : Method 'GetTypeInfoCount' of object ... failed

4. Better connect speeds with v.90

5. VC++ Import Type Library Problem

6. SyJet EIDE drive & Power Down

7. Type library problems?

8. FS: Lightly used External 8505XL tape drive

9. problem including type libraries

10. Problem creating a type library on an Alpha with MIDL

11. Problems with ClassWizard and VB OLE Type Libraries?

12. DCOM Error 80029C4A - Error loading type library/DLL (client side)

13. Client-Server Problem,client crashes