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).
# 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.
# 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 !