Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot use socketwrench from vfp
Message
De
09/09/2002 15:09:15
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Cannot use socketwrench from vfp
Divers
Thread ID:
00698459
Message ID:
00698459
Vues:
122
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
Répondre
Fil
Voir

Click here to load this message in the networking platform