theberry
The Berry
- Local time
- Today, 18:29
- Joined
- Jun 17, 2008
- Messages
- 7
I found the following code for that:
Private Declare Function WriteFile& Lib "kernel32" _
(ByVal hFile As Long, lpBuffer As Any, _
ByVal nNumberOfBytesToWrite&, _
lpNumberOfBytesWritten&, ByVal lpOverlapped&)
Private Declare Function ReadFile& Lib "kernel32" _
(ByVal hFile As Long, lpBuffer As Any, _
ByVal nNumberOfBytesToRead&, _
lpNumberOfBytesRead&, ByVal lpOverlapped&)
Private Declare Function CreateFile& Lib "kernel32" Alias "CreateFileA" _
(ByVal lpFileName$, ByVal dwDesiredAccess&, _
ByVal dwShareMode&, ByVal lpSecurityAttributes&, _
ByVal dwCreationDisposition&, ByVal dwFlagsAndAttributes&, _
ByVal hTemplateFile&)
Private Declare Function CloseHandle& Lib "kernel32" (ByVal hObject&)
Private Declare Function FlushFileBuffers& Lib "kernel32" (ByVal hFile&)
The problem is that when I try to read from the pad, the whole Access program freezes and waits for a byte to come in. Is there any way to generate an event when a byte is ready to read? Right now I poll the keypad every 100ms using the form timer, but it freezes.
I've been told I need an asynchronus read, but how do I do that?
Thanks in advance.
An old fogie rapidly advancing toward geezerhood.