Jump to content
  • Advertisement
Sign in to follow this  
rpg_code_master

Help with ActiveX/COM

This topic is 4846 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is probably stupidly broad, so forgive me. I have an ActiveX DLL that has been created using Visual Basic 6. How would I go about using this DLL with C++? The DLL has been registered with regsvr32 is that is of any help. Thank you. [Edited by - rpg_code_master on August 14, 2005 7:26:50 PM]

Share this post


Link to post
Share on other sites
Advertisement
What compiler/IDE are you using? Some of them have quite nice facilities for importing the type libraries to interface with ActiveX objects. Otherwise, you can probably download the Platform SDK to get the MIDL compiler to process the IDL file that VB6 should generate to get a header to access your ActiveX class. That's assuming I'm remembering correctly and VB6 creates a IDL file along with the DLL.

Worse comes to worse, your project should at least give you the CLSID, which you can pass to CoCreateInstance() to create an instance of the COM object, which you can then QueryInterface() for the IDispatch interface that all VB6 created COM components should implement. From there you can access the objects methods via the IDispatch::Invoke() function. Hopefully it wouldn't come to that though.

Share this post


Link to post
Share on other sites
It all depends on what is in the ActiveX components. If they are displayable components and you are using Visual Studio you can add it to your toolbox.

At a code level you need to use CoCreateInstance to instantiate the component. Then you can use QueryInterface etc. to get to the various interfaces exposed by the object.

It's probably worth reading up a bit on COM and ActiveX in order to understand what is going on.

Share this post


Link to post
Share on other sites
I know how to use the basics of COM from initializing Direct Draw. I've managed to get some info on the DLL from the OLE/COM tool. Would I just pump in the GUIDs from there into CoCreateInstance?

I am using VS.NET if you haven’t already guessed.

Do I need to create a header file for it?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!