Hi, guys. Long time no see. It's been like 1 year or so when I last posted here. Well, mainly in the C++ forum anyway. BTW, now I've got an issue. It's actually still a C++ one, but IMHO it's Windows related. I wanted to send a string to a COM port using the usual WriteFile command. But I don't know why, it's starting to loop endlessly (IMHO). The code is:
Code:
DWORD len;
DWORD dataLen = (DWORD) strlen( p_data );
std::cout<<"Data to be sent:"<<p_data<<std::endl;
if( WriteFile( m_hComm, p_data, dataLen,
&len, NULL ) == 0 )
{
MessageBox( NULL, "NO: Failed sending data.", "Debug", MB_OK );
return false;
}
MessageBox( NULL, "YES: Data sent.", "Debug", MB_OK );
When I started the code, it won't even display either one of the message boxes. What's wrong with it? Thanks in advance.