>>Wiki page recommends to use VFPCOM. VFPCOM dows not work with VFP 7.
>>So I used EVENTHANDLER() to attach my custom OnComm() event.
>>
>>I need to access to MSCOMM properties such as .input, .output
>>from attached event handler but this is impossible.
>>How to access control properties from binded event ?
>>
>
>Got me. I'm still using VFP6. My understanding is that VFP7 has VFPCOM built in. Check your documentation!
I explain my problem in VFP 6 terms.
Wiki page recommends to use the following sample.
It works, but I need to use loModemComm.Input property in basecustomclass.myoncomm event.
However, loModemComm variable is local variable and cannot be used.
How to use .Input property from myoncomm.oncomm() event without using global variable ?
DEFINE CLASS myoncomm AS basecustomclass
PROCEDURE oncomm
ENDPROC
ENDDEFINE
In your code:
loModemComm = NEWOBJECT("MSCOMMLib.MSComm")
loEventHandler = NEWOBJECT("MyOnComm", "OnComm")
loVFPCOM = NEWOBJECT("VFPCOM.ComUtil")
loVFPCOM.BindEvents(loModemComm, loEventHandler)
Andrus