Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Telnet Data Stream using Mabry Telnetx
Message
From
09/04/2005 06:04:03
 
 
To
04/04/2005 00:12:54
Donald Lowrey
Data Technology Corporation
Las Vegas, Nevada, United States
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01001138
Message ID:
01003002
Views:
23
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
Map
View

Click here to load this message in the networking platform