Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a white paper on writing ATL Controls for VFP?
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01061903
Message ID:
01061984
Views:
14
Hi,


never had a problem raising events in ATL COM and binding to them in VFP.

You may have a look at download #18695 - it's an ATL COM object with some events ... including sourcecode and VFP examples.

"Is it possible to write ATL Control with events binded to FoxPro object's methods without using the EVENTHANDLER()?"

Yes .. callback on an interface ...

e.g.
loObj = CREATEOBJECT('someEventHandler') && implements ISomeInterface
loAtlObj = CREATEOBJECT('theAtlObject')
loAtlObj.BindToEvents(loObj)
&& BindToEvents (i just named it like that)
&& would QueryInterface the passed object for ISomeInterface 
&& and store the pointer to it ..
&& in some other method which should raise events you would check if
&& an "EventObject" has been set and if so just call some method on
&& the ISomeInterface pointer ..
&& in this scenario you would also have to manually cleanup with a
&& "UnbindFromEvents" method

&& this is in essence the same as EVENTHANDLER does
&& but just manually coded ..
Regards
Christian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform