Error loading type library/DLL
-
I’m using idl file to create COM Type Library, Here is the idl: import "oaidl.idl"; import "ocidl.idl"; [ uuid(71050F79-3FC6-4BCA-BC36-A79465500B71), version(1.0), helpstring("MyProj 1.0 Type Library") ] library MyProjLib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); importlib("..\Interfaces\Interfaces.tlb"); [ uuid(83BC908B-C13C-4D6A-B290-C97057ACEBC4), helpstring("MyClass Class") ] coclass MyClass { [default] interface IMyProjMessage; }; }; In another project, I call the library with: #import "..\..\MyProj\MyProj.tlb" raw_interfaces_only, raw_native_types, no_namespace, named_guids Here’s the error I've got: fatal error C1084: Cannot read type library file: '..\..\MyProj\MyProj.tlb': Error loading type library/DLL. I am newer for com & activeX controls – can someone help me? Many thanks, S
-
I’m using idl file to create COM Type Library, Here is the idl: import "oaidl.idl"; import "ocidl.idl"; [ uuid(71050F79-3FC6-4BCA-BC36-A79465500B71), version(1.0), helpstring("MyProj 1.0 Type Library") ] library MyProjLib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); importlib("..\Interfaces\Interfaces.tlb"); [ uuid(83BC908B-C13C-4D6A-B290-C97057ACEBC4), helpstring("MyClass Class") ] coclass MyClass { [default] interface IMyProjMessage; }; }; In another project, I call the library with: #import "..\..\MyProj\MyProj.tlb" raw_interfaces_only, raw_native_types, no_namespace, named_guids Here’s the error I've got: fatal error C1084: Cannot read type library file: '..\..\MyProj\MyProj.tlb': Error loading type library/DLL. I am newer for com & activeX controls – can someone help me? Many thanks, S
Hello Sara123, Make sure that any dependency TLB(s) (e.g. ..\Interfaces\Interfaces.tlb) is/are either registered, or it/they is/are in a path that is discoverable by the compiler (e.g. in the same directory as MyProj.tlb). Hope this helps, - Bio.
-
Hello Sara123, Make sure that any dependency TLB(s) (e.g. ..\Interfaces\Interfaces.tlb) is/are either registered, or it/they is/are in a path that is discoverable by the compiler (e.g. in the same directory as MyProj.tlb). Hope this helps, - Bio.
-
Hello Sara123, No problem. But is your problem solved ? I suggest that your various dependency type libraries be registered. This way, the compiler will be able to refer to them when necessary. - Bio.
-
I’m using idl file to create COM Type Library, Here is the idl: import "oaidl.idl"; import "ocidl.idl"; [ uuid(71050F79-3FC6-4BCA-BC36-A79465500B71), version(1.0), helpstring("MyProj 1.0 Type Library") ] library MyProjLib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); importlib("..\Interfaces\Interfaces.tlb"); [ uuid(83BC908B-C13C-4D6A-B290-C97057ACEBC4), helpstring("MyClass Class") ] coclass MyClass { [default] interface IMyProjMessage; }; }; In another project, I call the library with: #import "..\..\MyProj\MyProj.tlb" raw_interfaces_only, raw_native_types, no_namespace, named_guids Here’s the error I've got: fatal error C1084: Cannot read type library file: '..\..\MyProj\MyProj.tlb': Error loading type library/DLL. I am newer for com & activeX controls – can someone help me? Many thanks, S
You need to define your interfaces first with the associated uuid, fore example import "oaidl.idl"; import "ocidl.idl"; [ object, uuid(BB137454-1CB9-469b-A398-5BDB535A1920), dual, nonextensible, helpstring("IMyProjMessageInterface"), pointer_default(unique) ] interface IMyProjMessage: IDispatch{ [id(1), helpstring("method Foo")] HRESULT Foo(); }; [ uuid(71050F79-3FC6-4BCA-BC36-A79465500B71), version(1.0), helpstring("MyProj 1.0 Type Library") ] library MyProjLib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); importlib("..\Interfaces\Interfaces.tlb"); [ uuid(83BC908B-C13C-4D6A-B290-C97057ACEBC4), helpstring("MyClass Class") ] coclass MyClass { [default] interface IMyProjMessage; }; };
JO :)
-
You need to define your interfaces first with the associated uuid, fore example import "oaidl.idl"; import "ocidl.idl"; [ object, uuid(BB137454-1CB9-469b-A398-5BDB535A1920), dual, nonextensible, helpstring("IMyProjMessageInterface"), pointer_default(unique) ] interface IMyProjMessage: IDispatch{ [id(1), helpstring("method Foo")] HRESULT Foo(); }; [ uuid(71050F79-3FC6-4BCA-BC36-A79465500B71), version(1.0), helpstring("MyProj 1.0 Type Library") ] library MyProjLib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); importlib("..\Interfaces\Interfaces.tlb"); [ uuid(83BC908B-C13C-4D6A-B290-C97057ACEBC4), helpstring("MyClass Class") ] coclass MyClass { [default] interface IMyProjMessage; }; };
JO :)