Click here to Skip to main content
15,890,690 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: missing storage-class or type specifiers Pin
Kranti12519846-Mar-06 17:44
Kranti12519846-Mar-06 17:44 
GeneralRe: missing storage-class or type specifiers Pin
Nibu babu thomas6-Mar-06 17:48
Nibu babu thomas6-Mar-06 17:48 
GeneralRe: missing storage-class or type specifiers Pin
Kranti12519846-Mar-06 17:50
Kranti12519846-Mar-06 17:50 
GeneralRe: missing storage-class or type specifiers Pin
Nibu babu thomas6-Mar-06 17:57
Nibu babu thomas6-Mar-06 17:57 
GeneralRe: missing storage-class or type specifiers Pin
Kranti12519846-Mar-06 18:02
Kranti12519846-Mar-06 18:02 
AnswerRe: missing storage-class or type specifiers Pin
Ghasrfakhri6-Mar-06 17:50
Ghasrfakhri6-Mar-06 17:50 
GeneralRe: missing storage-class or type specifiers Pin
Kranti12519846-Mar-06 17:54
Kranti12519846-Mar-06 17:54 
QuestionProblem with Serial Port Transmission Pin
BeakX6-Mar-06 17:23
BeakX6-Mar-06 17:23 
Hello,
I am using the bit of code below in a function to send instructions thru the serial port to some equipment and also to read off some feedback from
the equipment:
WriteFile(hCOM1, txbuff, 8, &bytesRead, NULL);

ReadFile(hCOM1, rxbuff, 8, &bytesRead, NULL);

Power= (((int)rxbuff[6])%4)*256 + (int)rxbuff[5];

When i am testing this function alone, it seem to work perfectly and obtain nice readings. However, when i integrate it with the rest of the program i find that the function gives wierd readings.I later found that this was due to the ReadFile portion reading the recieved portion at an offset, meaning there was some meaningless data before my actual portion of the feedback.
eg
I expect 255 255 43 .....
instead i get 05 04 255 255 43...
I managed to solve this problem by making use of the PURGE command.
However, i would like to know, why does the offset of data occurr ?
Is there any better way to solve this problem instead of PURGE ?
Thanks
AnswerRe: Problem with Serial Port Transmission Pin
Ryan Binns6-Mar-06 17:30
Ryan Binns6-Mar-06 17:30 
QuestionTriangle * Pin
yaaqub6-Mar-06 17:03
yaaqub6-Mar-06 17:03 
AnswerRe: Triangle * Pin
Nibu babu thomas6-Mar-06 17:16
Nibu babu thomas6-Mar-06 17:16 
Questionto read a text file Pin
beardy janggut6-Mar-06 16:40
beardy janggut6-Mar-06 16:40 
AnswerRe: to read a text file Pin
Nibu babu thomas6-Mar-06 21:06
Nibu babu thomas6-Mar-06 21:06 
QuestionProcessShellCommand Pin
derek76-Mar-06 16:33
derek76-Mar-06 16:33 
AnswerRe: ProcessShellCommand Pin
Nibu babu thomas6-Mar-06 18:33
Nibu babu thomas6-Mar-06 18:33 
Questionwindows service with ui on vista Pin
chenxiujie6-Mar-06 16:26
chenxiujie6-Mar-06 16:26 
AnswerRe: windows service with ui on vista Pin
Gavin Taylor6-Mar-06 18:12
professionalGavin Taylor6-Mar-06 18:12 
AnswerRe: windows service with ui on vista Pin
chenxiujie6-Mar-06 18:19
chenxiujie6-Mar-06 18:19 
QuestionMFC Pin
sthalasayanam6-Mar-06 15:56
sthalasayanam6-Mar-06 15:56 
AnswerRe: MFC Pin
derek76-Mar-06 16:37
derek76-Mar-06 16:37 
GeneralRe: MFC Pin
J51219826-Mar-06 19:11
J51219826-Mar-06 19:11 
Questionmfc42.dll < mfc42d.dll Pin
derek76-Mar-06 15:46
derek76-Mar-06 15:46 
AnswerRe: mfc42.dll < mfc42d.dll Pin
Ryan Binns6-Mar-06 17:20
Ryan Binns6-Mar-06 17:20 
GeneralRe: mfc42.dll < mfc42d.dll Pin
derek76-Mar-06 19:09
derek76-Mar-06 19:09 
GeneralRe: mfc42.dll < mfc42d.dll Pin
Ryan Binns6-Mar-06 19:38
Ryan Binns6-Mar-06 19:38 

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.