Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot use socketwrench from vfp
Message
From
09/09/2002 15:09:15
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Cannot use socketwrench from vfp
Miscellaneous
Thread ID:
00698459
Message ID:
00698459
Views:
123
I downloaded SocketWrench Freeware Edition activex control from
www.catalyst.com and added it to a vfp form.

I put the following code to a form init method.
However, this code does not work: pressing a key will not send
any data to internet. Why ?
SET TALK OFF
SET ECHO OFF
_vfp.AutoYield = .t.

thisform.socket1.HostName = "www.online.ee"
thisform.socket1.RemotePort = 7

If !thisform.socket1.Connect() 
  MESSAGEBOX( "Unable to connect to remote host")
  RETURN .f.
  ENDIF

CLEAR
?? thisform.socket1.hostaddress
?

cstr = SPACE(4)
ckey =0
DO while ckey#27
  ckey = INKEY(1)
  IF ckey#0
    thisform.socket1.Write( CHR(ckey), 1 )
    thisform.socket1.flush()
    ?? CHR(ckey)
    ENDIF
  cstr=SPACE(1)
  thisform.socket1.read( @cstr, 1 )
  IF !EMPTY(cstr)
    ??cstr
    ENDIF
  enddo      
RETURN .f.
Andrus
Reply
Map
View

Click here to load this message in the networking platform