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