Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using custom classes with ActiveX

0 views
Skip to first unread message

gordon.i...@gmail.com

unread,
Jan 28, 2009, 1:55:03 AM1/28/09
to

Hi,

I am attempting to add a simple class to an ActiveX control to carry
out logging. In the initial ActiveX class this is simple, as I create
a pointer to my custom class in InitInstance() and then use that to
call my method. But when I try to do the same in the control class, I
have the issue of passing the instance created in InitInstance to this
class.
I can do this in the constructor, but I'm not convinced this works
since the control crashes when it's being called. I know it's not the
initial class crashing as this works on it's own.

Anyway, my main question is, when you want to hold an instance as a
member variable in the control class, what is the recommended way? I
notice that in the control constructor it is loaded in a macro
DYN_CREATE(Class); I wondered if this would effect using a non-default
contstructor (i.e. passing in my instance as a parameter from the
InitInstance() class). Also, as I'm not sure where the control class
constructor is called, I don't know where to pass in the instance (I
assume InitInstance calls it or some part of the ActiveX container).

Sorry for being vague, I don't have the code here with me at the
moment.

Regards,
Gordy.

0 new messages