Re: How to receive events from objects?
Posted: Mon Jun 16, 2014 1:31 am
And here an example of use:
__axRegisterHandler( o:__hObj, {| ... | MsgInfo( ... ) } )
__axRegisterHandler( o:__hObj, {| ... | MsgInfo( ... ) } )
www.FiveTechSoft.com
https://forums.fivetechsupport.com/
https://forums.fivetechsupport.com/viewtopic.php?f=3&t=28657
What are the parameters of the codeblock?
cIID
Specifies the Interface ID GUID of cCLSID | cPROGID when you create an early bound instance of the class. If you pass an empty string as cIID Visual FoxPro attempts to access the default interface (IID) of cCLSID | cPROGID.
Example
x = CREATEOBJECTEX("excel.application","",;
"{000208D5-0000-0000-C000-000000000046}")
Method Instantiate_Device(cProgID) class OPOSHardwareInterface
local oOle:='',n
local ciid:='{B196B284-BAB4-101A-B69C-00AA00341D07}' && <-- IconnectionPointContainer
::lDeviceInstantiated:=.f.
oOle:=CreateObject(cProgID)
if valtype(oOle)='O'
::lDeviceInstantiated:=.t.
if cprogid='OPOS.POSPrinter'
alert(ciid)
__axRegisterHandler( oOle:__hObj, {| ...| MsgInfo( 'Test') },ciid) && <-- IconnectionPointContainer
alert('Handler registered')
endif
aadd(::aoDevices,oOle)
endif
return oOle