Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using serial port without writing to registry
Message
De
22/11/2004 15:48:31
 
 
À
17/11/2004 13:31:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00961648
Message ID:
00963634
Vues:
11
Are you using direct API calls in real-world solution to communicate with COM port ?

>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.
Andrus
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform