Passing a pointer to an object in an ActiveX event

  • Thread starter Thread starter Lucy Ludmiller
  • Start date Start date
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 ??
 
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.
 
Back
Top