General information
Category:
Third party products
Hello Don,
you have to hook into the Events the COM object fires (Received event is what you're interested in)
here're some tips on how to get started:
1. Start the "Object Browser" from the VFP Tools Menu
2. Load the Mabry Control into it
3. Find the interface which implements the events
4. Drag & Drop the interface from the object browser into open prg editing window, this will create a blueprint class with the correct method declarations for you
5. bind the Mabry object and an instance of your class created in Step 4 at runtime
e.g.
assuming you named the class "oTelnetEvents"
loTelNetX = CREATEOBJECT('Mabry.TelNetX(orwhateverCoClassNameithas)')
loEvents = CREATEOBJECT('oTelNetEvents')
IF EVENTHANDLER(loTelNet,loEvents)
? "Event binding successful"
ENDIF
loTelNetX.Connect() &&Connects, authenticates
loTelNetX.Send("") &&which is satisfied by the empty string
from now on the communication is event based, that is everytime the Mabry control detects that there is data for you to read it will fire the Received event in the loEvents object
so you might want to write something like this
FUNCTION Received(ByteCount as Long)
LOCAL lcData
lcData = loTelNetX.Receive()
&& do something with the data
ENDFUNC
in the oTelNetEvents eventhandler class
Regards
Christian
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only