VB6 ActiveX Dll

G

Guest

Good Day All,

I have an ActiveX DLL written in VB6. It defines a COM interface.

I need to be able to use this interface in C++. However, since I don't have
a header file I am not sure how to reference it. I have the lib file and the
exp file created when the dll is compiled in VB6.

I tried using an "import" statement but that didn't seem to work. Is there a
way to generate a header file from the dll?

Any help is appreciated. Thanks!
 
A

Atul

Use 'Add Class from Type Library' to generate the header file for the
ActiveX.

-Atul, Sky Software http://www.ssware.com
Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
 
R

Rodrigo Corral [MVP]

Why do you think that #import doesn't work? Maybe you are not using #import
well. Be aware that #import creates the smart pointer classes which you use
for access the COM object inside a namespace.

As second option, OleView can be used in order to generate the needed
header.
File->View Type Library...
and in the new window opened
File->Save As...
and select .h and .c (for the c file containing the guids).
Finally add the .h and .c to your project.

--
Un saludo
Rodrigo Corral González [MVP]

FAQ de microsoft.public.es.vc++
http://rcorral.mvps.org
 
G

Guest

Atul and Rodrigo,

Thank you for your replies. I really appreciate it and the helped.

I have one follow up question. Both of you suggested different methods for
accomplishing this. Is one of these methods prefered over the other? It
appears to me that the both will accomplish the same thing. What is the
difference?

Thanks again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top