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. ATL/COM and #import directive

ATL/COM and #import directive

Scheduled Pinned Locked Moved COM
helpcomc++
4 Posts 4 Posters 2 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hello everyone. This is my first ATL/COM project, and I think the progress is "behaving" so far (happy to be one week behind the deadline). However, there is one dead-end issue that I cannot resolve: Within my ATL component, I have to use a couple of in-proc Visual Basic - based COM .dll's. I use #import "XXXX.dll" in my source code, but compiler spits out the error "fatal error C1084: Cannot read type library file: 'XXXX.dll': Element not found." Note that regsvr32 has successfully registered that .dll and .dll's path is correct. Another spooky observation: OLE View fails to open .dll's IDL file giving me "Could not decompile selected item. Element not found" error message. If anyone can help, please save me from this miseary. BIG thanks in advance. Kirill Sherman shermank@glstrat.com

    J R 2 Replies Last reply
    0
    • L Lost User

      Hello everyone. This is my first ATL/COM project, and I think the progress is "behaving" so far (happy to be one week behind the deadline). However, there is one dead-end issue that I cannot resolve: Within my ATL component, I have to use a couple of in-proc Visual Basic - based COM .dll's. I use #import "XXXX.dll" in my source code, but compiler spits out the error "fatal error C1084: Cannot read type library file: 'XXXX.dll': Element not found." Note that regsvr32 has successfully registered that .dll and .dll's path is correct. Another spooky observation: OLE View fails to open .dll's IDL file giving me "Could not decompile selected item. Element not found" error message. If anyone can help, please save me from this miseary. BIG thanks in advance. Kirill Sherman shermank@glstrat.com

      J Offline
      J Offline
      Joseph Dempsey
      wrote on last edited by
      #2

      it sounds like you have not compiled your typelibrary into your application. What you need to do is in your .rc file create a custom resource called "TYPELIB" and point it to your .tlb file. This will inclued the tlb in your final compiled DLL so that it can be imported. Your other alternative is to import the actual tlb file instead of the DLL. Hope this helps. Joseph Dempsey jdempsey@cox.rr.com Joseph.Dempsey@thermobio.com "Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning." --anonymous

      1 Reply Last reply
      0
      • L Lost User

        Hello everyone. This is my first ATL/COM project, and I think the progress is "behaving" so far (happy to be one week behind the deadline). However, there is one dead-end issue that I cannot resolve: Within my ATL component, I have to use a couple of in-proc Visual Basic - based COM .dll's. I use #import "XXXX.dll" in my source code, but compiler spits out the error "fatal error C1084: Cannot read type library file: 'XXXX.dll': Element not found." Note that regsvr32 has successfully registered that .dll and .dll's path is correct. Another spooky observation: OLE View fails to open .dll's IDL file giving me "Could not decompile selected item. Element not found" error message. If anyone can help, please save me from this miseary. BIG thanks in advance. Kirill Sherman shermank@glstrat.com

        R Offline
        R Offline
        Ryan Park
        wrote on last edited by
        #3

        What about your IDL definition? If you don't mind, show your idl definition. MIDL compiler don't generate type library without proper keywords. Regards, Ryan

        S 1 Reply Last reply
        0
        • R Ryan Park

          What about your IDL definition? If you don't mind, show your idl definition. MIDL compiler don't generate type library without proper keywords. Regards, Ryan

          S Offline
          S Offline
          SuperGeek
          wrote on last edited by
          #4

          Thanks for your concern, but I asked the author of those VB components to recompile his works. Don't understand why, but after recompilation, I could view all the IDL's with OLE Viewer and #import them without any problems. As long as it works - I am happy.

          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