返回首页

您好,

我写了一个代码与串口通信("COM1:")。
根据Win32 API的正常工作。 EVC4在相同的代码,没有任何错误的编译和建立链接("COM1:"),但是,当它执行ReadFile的声明:

 song=ReadFile(

    hComm   ,       // handlePort_: handle of file to read

    (BYTE*)tmpMsg,  // inputData:handle of file to read

    400     ,       // sizeBuffer:number of bytes to read

    BytesRead,     // pointer to number of bytes read

    NULL    );      // pointer to structure for data

,它显示了这首歌是真实但BytesRead的= 0。

如何得到它能够正常工作的任何暗示?
谢谢EsmatB

回答