Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using serial port without writing to registry
Message
De
17/11/2004 13:31:26
 
 
À
17/11/2004 12:19:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00961648
Message ID:
00962316
Vues:
15
When the port is open you must call ReadFile & WriteFile for read and write data the in COM port.

---------------------------------------
Declare Long ReadFile in "kernel32" Long hFile , STRING @lpBuffer, Long nNumberOfBytesToRead, Long @lpNumberOfBytesRead, long lpOverlapped

LOCAL hPort,lpNumberOfBytesRead, lpBuffer
lpNumberOfBytesRead = 50
lpBuffer = SPACE(50)
hPort = CreateFile (lcPort, GENERIC_READ, 0,0,;
OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0)

ReadFile( hPort, @lpBuffer, 50, @lpNumberOfBytesRead, 0 )

IDEM for WriteFile function.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform