Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using serial port without writing to registry
Message
From
17/11/2004 13:31:26
 
 
To
17/11/2004 12:19:40
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00961648
Message ID:
00962316
Views:
16
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform