cout<<"getting in issue read operation"<<endl;
ReadFile(hSerial, readbuff, dwBytesRead, &dwBytesRead, NULL);
cout<<"error: "<<GetLastError()<<endl;
if (!ReadFile(hSerial, readbuff, dwBytesRead, &dwBytesRead, NULL))
{
if (GetLastError() != ERROR_IO_PENDING)
cout << "Error in communications; report it.";
else
fWaitingOnRead = TRUE;
}
else
{
cout << "no waiting\n";
cout << "no. of bytes read: " <<dwBytesRead << endl;
cout<<"read buff: ";
for (DWORD i = 0; i < sizeof(writebuff); i++)
{
cout<< readbuff[i];`enter code here`
}
cout<<endl;
}
私は何がうまくいかないのか理解できません。各ティムが0バイトを読み取っています.....助けてくださいplzzz.....