Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MSComm32.ocx
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Divers
Thread ID:
00870153
Message ID:
00872193
Vues:
14
Thanks! I couldn't get Grier's form to work any better than my own, and none of the bells and whistles worked (thermometer, transfer rate, etc.). I have successfully gotten the computers to connect and send/receive the file, but the file cannot be opened on the receiving computer. I have tried .doc's, .dbf's, and .jpg's. I think that the trouble occurs when I am converting from binary to text and back to binary so I can send one byte at a time. I have tried InputMode of 1)Text and 2)Binary, and tried sending the whole file at once. Any ideas on the problem/solution? Here is my code:
Receiving computer:
Form Init:
PUBLIC gnFileHandle
IF FILE('c:\temp.dbf')
gnFile = FOPEN('c:\temp.dbf', 12)
ELSE
gnFile = FCREATE('c:\temp.dbf')
ENDIF
=FCLOSE(gnFile)
STORE FOPEN('c:\temp.dbf', 1) TO gnFileHandle
***************************
Olecontrol OnComm:
IF This.CommEvent = 2 AND This.InBufferCount > 0
lcInput = CHR(VAL(This.Input))
=FWRITE(gnFileHandle, lcInput)
This.output = CHR(26)
ENDIF
***************************
Settings:
Handshaking: 2
InputMode: Binary
RThreshold: 3
SThreshold: 1
***************************
Sending computer:
Form Init:
CLOSE ALL
PUBLIC gnFileHandle
PUBLIC gnEnd
PUBLIC gnTop
PUBLIC q
STORE FOPEN('c:\temp.txt') TO gnFileHandle
STORE FSEEK(gnFileHandle, 0, 2) TO gnEnd
STORE FSEEK(gnFileHandle, 0) TO gnTop
gntop=1
q=""
***************************
OnComm Event:
IF This.CommEvent = 2
This.input
IF gnTop <= gnEnd
gcString = FREAD(gnFileHandle, 1)
q=asc(gcstring)
thisform.olecontrol1.output = str(q, 3)
gnTop = gnTop + 1
ENDIF
ENDIF
*****************************
InputMode: Binary
RThreshold: 1
SThreshold: 1

Also, the files are transferring at a rate of only 1K every 3 minutes. I have 56K modems (v.90 and v.92). Why is it so slow?

Jerry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform