求教如何实现同一串口在不同程序间的共享?CreateFile的共享参数File_Share_Read等本人试用无效,不知是真无效还是使用的问题。
解决方案 »
- Socket Connect的一个问题
- WaitForMultipleObjects函数疑问
- mobile的COM组件可以在PC机上面注册吗
- 如何得到窗口大小
- 简单问题在线等待!急!!!!!!!!!高分60
- GroupBox重载?
- 在线求救!!!!!!!!!!
- 关于定时器的问题
- 画图板的填充功能的实现(急求)
- 我用MFC编程 HDC hdc=GetDC(NULL); 它老报错?!
- 问了一天的问题,估计有些人都看腻了,可还是没人能帮我,可怜!!!
- 我加入Component Gallery中的tips for the day后,每次运行结果先出来tips for the day,点了关闭以后,窗口才产生!!
m_hComm = CreateFile("COM1", // communication port string (COMX)
GENERIC_READ | GENERIC_WRITE, // read/write types
0, // comm devices must be opened with exclusive access
NULL, // no security attributes
OPEN_EXISTING, // comm devices must use OPEN_EXISTING
FILE_FLAG_OVERLAPPED, // Async I/O
0); // template must be 0 for comm devices
The CreateFile function can create a handle to a communications resource, such as the serial port COM1. For communications resources, the dwCreationDisposition parameter must be OPEN_EXISTING, and the hTemplate parameter must be NULL. Read, write, or read/write access can be specified, and the handle can be opened for overlapped I/O. For more information about communications, see Communications. 说明未表明不能共享呀?