Passing a pointer to an object in an ActiveX event

L

Lucy Ludmiller

I have a class CMyObject, that I want to pass in an ActiveX event.

I have not as yet found a way of passing pointers in events - any one
knows how ?

//PseudoCode IDL
[id(1)] void HereComesMyObject(CMyObject*); // <- How ??
 
S

SvenC

Hi Lucy,

Lucy Ludmiller said:
I have a class CMyObject, that I want to pass in an ActiveX event.

I have not as yet found a way of passing pointers in events - any one
knows how ?

//PseudoCode IDL
[id(1)] void HereComesMyObject(CMyObject*); // <- How ??

COM is about passing interface pointers not object pointers. So make
CMyObject a COM object implementing an interface like IMyObject.
When you want to be automation compatible (i.e. mostly necessary to function
in VB/VBA) you will need to pass an IDispatch pointer IIRC.
 

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