以前在win98下用delphi5开发了个多串口通信软件,是用SPComm控制猫通信,一直好好的。后来在win2k下重编译了一下,在win2k下使用,就出现了问题,打开Comm9以下的端口没问题,而打开Comm10以上的端口就报错,说不能打开,多串口通信是还是好的。请问有那位大虾知道这是什么原因引起的?

解决方案 »

  1.   

    98下32个串口都能访问,2k下只能访问到9,知道为什么嘛?控件是SPComm
      

  2.   

    修改源碼:
    找到 CreateFile, 修改第一個參數為: \\XXX\, 而不是直接用XXX
    XXX應該是 ComName 之類的名稱解釋如下:lpFileName 
    [in] Pointer to a null-terminated string that specifies the name of the object to create or open. 
    In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File.
      

  3.   

    好的,我试一下她CreateFile的第一个参数是PChar(FCommName)我改成了PChar('\\'+FCommName+'\')是这个意思吧一会告诉你试验结果