关于CreateFile打开调制解调器串口的问题。
win2000下安装一软猫,系统分配port是COM13,用CreateFile无法成功打开。
//-------代码如下,打开COM1, COM2都是可以成功的,不知和软猫有没有关系
//-------或者CreateFile打开串口只能是COM1到COM9???可有人能告诉我??
hCom = CreateFile( buf,
GENERIC_READ | GENERIC_WRITE,
0, // comm devices must be opened w/exclusive-access
NULL, // no security attributes
OPEN_EXISTING, // comm devices must use OPEN_EXISTING
0, // not overlapped I/O
NULL // hTemplate must be NULL for comm devices
);
if(INVALID_HANDLE_VALUE == hCom) {
WriteDebug(ERROR_LEVEL,"OpenComPort","Failed to open %s!\n",buf);
return NULL;