Simple problem

Hi. I have a simple problem:

I have an ActiveXControl with this classes :

class CFgMfcControlCtrl : public COleControl
{
public:
double GetFahrfreigabe();
SetFahrfreigabe(double);
private:
double m_fahrfreigabe;
}

class CFgMfcControlPropPage : public COlePropertyPage
class CFgMfcControlApp : public COleControlModule

// this is my own class
class CFgEvent
{
}

Now i want access from my own class (CFgEvent) to

m_fahrfreigabe;

How can i do this?
Thank you
[590 byte] By [JavaEngel] at [2007-11-17 0:01:29]
# 1 Re: Simple problem
If you want to read m_fahrfreigabe, u can do this with GetFahrfreigabe (), and if you want to write m_fahrfreigabe, u can do it with SetFahrfreigabe (your new value).
irona20 at 2007-11-10 6:41:05 >
# 2 Re: Simple problem
Ok. I tryed this. But I always get undeclared identifier. If I include the file I have no access because the functions are protected.

Can you help anymore?
Thanks
JavaEngel at 2007-11-10 6:42:05 >
# 3 Re: Simple problem
How does CFgEvent has access to a CFgMfcControlCtrl object?

Truth,
James
http://www.NJTheater.com
http://www.NovelTheory.com
I don't do it for the points (OK, maybe I do), but rating a post is a good way for me to know if I helped.
James Curran at 2007-11-10 6:43:04 >
# 4 Re: Simple problem
First embed the own ActiveX class into your project (Class wizard/add class/from type library: enter the name of your ActiveX tlb: FgMfcControlCtrl.tlb; in the "Confirm classes dlg box, enter other names than the given ones otherwise you will overwrite your own files ! for example DFgMfcControlCtrl.cpp/h)
In FgEvent.cpp include DFgMfcControlCtrl.h, then call your control method:
ULONG nObj;
LPDISPATCH* ppDisp = GetObjectArray(&nObj);
COleDispatchDriver dispdrv;
dispdrv.AttachDispatch (ppDisp[0], FALSE);
D_FgMfcControlCtrl myctrl;//wrapper class
myctrl.AttachDispatch(ppDisp[0],FALSE);
// And finally call your method
double Fahrfreigabe=myctrl.GetFahrfreigabe();

Hope, it helps !
jeanclaude at 2007-11-10 6:44:08 >