Click here to Skip to main content
15,920,217 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionwhy "default Beep" windows sound is played Pin
singersinger21-Nov-06 2:11
singersinger21-Nov-06 2:11 
AnswerRe: why "default Beep" windows sound is played Pin
Viorel.21-Nov-06 2:49
Viorel.21-Nov-06 2:49 
GeneralRe: why "default Beep" windows sound is played Pin
singersinger21-Nov-06 2:59
singersinger21-Nov-06 2:59 
GeneralRe: User Feedback Pin
Waldermort21-Nov-06 2:59
Waldermort21-Nov-06 2:59 
QuestionCtreeCtrl Popupmenu Pin
harsha_123421-Nov-06 1:08
harsha_123421-Nov-06 1:08 
AnswerRe: CtreeCtrl Popupmenu Pin
Mila02521-Nov-06 1:39
Mila02521-Nov-06 1:39 
AnswerRe: CtreeCtrl Popupmenu Pin
Viorel.21-Nov-06 2:08
Viorel.21-Nov-06 2:08 
QuestionProblems with ClearCommError Pin
Demian Panello21-Nov-06 1:07
Demian Panello21-Nov-06 1:07 
Hi.

I have developed an aplication that it read and write bytes through the serial ports. The program works fine, except for some PCs, (very few ones). While is reading the data, sometimes it ends the communication suddenly.
I found that it happend because ClearCommError fails, I have the following code:

<br />
<br />
...<br />
<br />
// the following loop try to send a command and read the answer<br />
while( retry> 0 )<br />
{<br />
<br />
  // the problem is here, when that function fails 		<br />
  if( !ClearCommError( idCommDev, &dwError,&comstatInfo ))<br />
{<br />
   lResult = 116;<br />
  dwLasError = GetLastError();  // I call GetLastError() but I get -1.  ???????<br />
   return lResult;<br />
}<br />
<br />
if( !PurgeComm( idCommDev, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR ))<br />
{<br />
  lResult = 115;<br />
  return lResult;<br />
}<br />
// Send a command<br />
lResult = TXPacket(dataTX, 250);<br />
<br />
if( lResult!= 0 )<br />
   return lResult;<br />
<br />
// Read the answer<br />
lResult = RXPacket(dataRX, timeout);<br />
....<br />
<br />


This is my problem. In some PC, (I don't know why), the function ClearCommError() fail with no error code available with GetLastError(), so I can't figure out what is happened.

Thank you.

Demian.

"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."

-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )

QuestionAbout MCI Player Pin
Raja Bose C Leo21-Nov-06 1:06
Raja Bose C Leo21-Nov-06 1:06 
Questionquestion about MSXML ? Pin
Sakthiu21-Nov-06 0:55
Sakthiu21-Nov-06 0:55 
QuestionRe: question about MSXML ? Pin
CPallini21-Nov-06 2:26
mveCPallini21-Nov-06 2:26 
QuestionHow to get Size of safearray Pin
narayanagvs21-Nov-06 0:36
narayanagvs21-Nov-06 0:36 
AnswerRe: How to get Size of safearray Pin
James R. Twine21-Nov-06 0:46
James R. Twine21-Nov-06 0:46 
QuestionSHBrowseForFolder() API pb Pin
super_ttd21-Nov-06 0:32
super_ttd21-Nov-06 0:32 
AnswerRe: SHBrowseForFolder() API pb Pin
James R. Twine21-Nov-06 0:50
James R. Twine21-Nov-06 0:50 
GeneralRe: SHBrowseForFolder() API pb Pin
super_ttd21-Nov-06 1:31
super_ttd21-Nov-06 1:31 
AnswerRe: SHBrowseForFolder() API pb Pin
David Crow21-Nov-06 3:26
David Crow21-Nov-06 3:26 
GeneralRe: SHBrowseForFolder() API pb Pin
super_ttd21-Nov-06 3:30
super_ttd21-Nov-06 3:30 
GeneralRe: SHBrowseForFolder() API pb Pin
David Crow21-Nov-06 3:38
David Crow21-Nov-06 3:38 
GeneralRe: SHBrowseForFolder() API pb Pin
super_ttd21-Nov-06 3:39
super_ttd21-Nov-06 3:39 
QuestionReadDirectoryChangesW doesn't get message about deleting whole directory [modified] Pin
rudo3221-Nov-06 0:19
rudo3221-Nov-06 0:19 
AnswerRe: ReadDirectoryChangesW doesn't get message about deleting whole directory Pin
Ștefan-Mihai MOGA21-Nov-06 0:30
professionalȘtefan-Mihai MOGA21-Nov-06 0:30 
GeneralRe: ReadDirectoryChangesW doesn't get message about deleting whole directory Pin
rudo3221-Nov-06 1:30
rudo3221-Nov-06 1:30 
AnswerRe: ReadDirectoryChangesW doesn't get message about deleting whole directory Pin
Nibu babu thomas21-Nov-06 0:32
Nibu babu thomas21-Nov-06 0:32 
JokeRe: ReadDirectoryChangesW doesn't get message about deleting whole directory Pin
rudo3221-Nov-06 1:12
rudo3221-Nov-06 1:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.