此帖出自嵌入式系统论坛
最新回复
谢谢各位. 用了楼上大方法.
//Open file on the device
deviceHandle = CreateFile (deviceDetail->DevicePath,
GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, // no SECURITY_ATTRIBUTES structure
OPEN_EXISTING, // No special create flags
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
NULL); // No template file
现在读写不会死机. 但
if(ReadFile(
deviceHandle[IndexInFieldList], // handle of file to read
buffer, // pointer to buffer that receives data
49, // number of bytes to read
&lpNumberOfBytesRead, // pointer to number of bytes read //从第一个字节开始读接收到的数据.
&m_OverlappedInputReport // pointer to structure for data
))
读写失败. 读不出数据来. 奇怪.
详情
回复
发表于 2007-11-6 09:51
| ||
|
||
此帖出自嵌入式系统论坛
| ||
|
||
| |
|
|
| |
|
|
| |
|
|
此帖出自嵌入式系统论坛
| ||
|
||
此帖出自嵌入式系统论坛
| ||
|
||
EEWorld Datasheet 技术支持