MsComm responds irregularly in a dongle
- From: "homeologica" <homeologica@xxxxxxxxxxx>
- Date: Wed, 11 Jan 2006 21:43:34 -0500
I'm doing a dongle to protect an application. This is connected to the
serial port and a programm read a string on it.
This library responds sometimes well and other times wrong.
I use VFP7 SP1 in WinXP
This is the source code which gives me problems.
**************************************************************
valorletras= zarray[Letras] && read a value from an array
MSComm1=CreateObject("MSCOMMLib.MSComm")
MSComm1.CommPort = 1
IF mscomm1.PortOpen = .F.
mscomm1.PortOpen = .T.
ENDIF
=INKEY(0.5)
valordeentrada =asc(valorLetras)+32 && encrypts this value
mscomm1.Output = CHR(valordeentrada) && send this encrypted value to the
dongle
=INKEY(0.5)
LOCAL lectura
lectura =0
lectura=mscomm1.input && read the returning value which must be 'z'
**************************************************************
Changing times of waiting with INKEYs statements doesn't work.
Must I do something in order to improve the port's work?
Thanks.
Alejandro Fernandez
.
- Prev by Date: Re: Nullsoft script for installing VFP
- Next by Date: Avoiding crashes caused by SELECT SQL
- Previous by thread: Nullsoft script for installing VFP
- Next by thread: Avoiding crashes caused by SELECT SQL
- Index(es):
Relevant Pages
|