Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Error loading type library/DLL

Error loading type library/DLL

Scheduled Pinned Locked Moved COM
comhelpquestionannouncement
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sara123
    wrote on last edited by
    #1

    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

    L J 2 Replies Last reply
    0
    • S Sara123

      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

      L Offline
      L Offline
      Lim Bio Liong
      wrote on last edited by
      #2

      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.

      S 1 Reply Last reply
      0
      • L Lim Bio Liong

        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.

        S Offline
        S Offline
        Sara123
        wrote on last edited by
        #3

        thank you so much of your briefly answer! :) S

        L 1 Reply Last reply
        0
        • S Sara123

          thank you so much of your briefly answer! :) S

          L Offline
          L Offline
          Lim Bio Liong
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • S Sara123

            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

            J Offline
            J Offline
            Ju ncho
            wrote on last edited by
            #5

            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 :)

            J 1 Reply Last reply
            0
            • J Ju ncho

              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 :)

              J Offline
              J Offline
              Ju ncho
              wrote on last edited by
              #6

              oops sorry i didnt saw the importlib("..\Interfaces\Interfaces.tlb"); line, you should assert that MIDL can find the .tlb file

              JO :)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups