Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert C++ DLL to ActiveX Control?

Status
Not open for further replies.

MrPeds

Programmer
Jan 7, 2003
219
GB
Hi,

I have recently written a simple DLL using VC++ 6.

The DLL basically displays a dialogue box with a progress bar in it and carries out some calculations and processing in the 'background'. once finished i simply press ok and the app closes down.

The DLL is called from a VB application. I would like to make the dialogue part of the VB user-interface to embed the dialogue in the VB form so thought converting the DLL into an ActiveX component would be what I need?

If so, are there any software packages that convert DLL's into ACtiveX components? If not, can anybody reccommend some quick approaches of converting this DLL?

Thanks in advance,

MrPeds
 
I think the easiest way to do this is to create an empty ActiveX project (ATL or MFC) and cut and paste the relevent code into the new project.


Greetings,
Rick
 
If the code in your DLL project is designed in a normal fashion you should have all the meaningful code isolated into classes and their .h/.cpp files.

If that were the case you can start a new ActiveX project and add the h./.cpp files to the project and use them as you would in any other project.

This is how all COM project should be developed IMHO. Develop the code that you want to expose as basic C++ classes in a Win32 application and unit test the code. Then create a COM project and use those classes behind the COM interfaces. This way the COM code is merely wrapper code that provides the COM plumbing to expose the functionality of the C++ classes to COM consumers. The code that provides the actual value of the control is isolated and can be tested in a non COM environment.


-pete
I just can't seem to get back my IntelliSense
 
thanks for this guys - I will try the cut and paste approach first and let you know how i get on.

I think this project is a perfect example of 'hacking' something to get it to work, but not being able to write the code how you want it to be written!

Thanks

MrPeds
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top