Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Instantiating an ActiveX Object

Tags:

c++

com

activex

I have imported an ActiveX library into my project in Visual Studio 2008 using:

#import "TeeChart8.ocx" named_guids

Now I would like to create objects exposed by the ActiveX library. However, I am having trouble understanding the API.

There are two files that were created after I built the project with the #import, a .tli file and a .tlh file.

In the .tlh file there is the following line:

_COM_SMARTPTR_TYPEDEF(ITChart, __uuidof(ITChart));

I can see ITChart when I open the ActiveX library TeeChart8.ocx in the ITypeLib Viewer (Oleview). Also, if I type ITChartPtr->Invoke into my code, intellisense shows me that there are a whole bunch of parameters that need to be filled.

Essentially, I would like to know how to instantiate an ActiveX object and where I have to look to get the information I need?

like image 941
Seth Avatar asked May 10 '26 20:05

Seth


1 Answers

Maybe not enough to create ActiveX function CoCreateInstance. ActiveX must be correctly initialized (Theory can be found here ActiveX Controls Overviews and Tutorials :-)

The easiest way is to use CAxWindow (ATL Framework)

Here, collected various information on how to create ActiveX controls

like image 111
Victor Avatar answered May 13 '26 09:05

Victor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!