Click here to Skip to main content
15,902,635 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: LNK2001 and LNK2019 errors Pin
Krzysiaczek9928-Mar-10 3:32
Krzysiaczek9928-Mar-10 3:32 
GeneralRe: LNK2001 and LNK2019 errors Pin
Richard MacCutchan28-Mar-10 4:33
mveRichard MacCutchan28-Mar-10 4:33 
GeneralRe: LNK2001 and LNK2019 errors Pin
Krzysiaczek9928-Mar-10 4:49
Krzysiaczek9928-Mar-10 4:49 
GeneralRe: LNK2001 and LNK2019 errors Pin
Richard MacCutchan28-Mar-10 4:53
mveRichard MacCutchan28-Mar-10 4:53 
GeneralRe: LNK2001 and LNK2019 errors Pin
Krzysiaczek9928-Mar-10 5:29
Krzysiaczek9928-Mar-10 5:29 
GeneralRe: LNK2001 and LNK2019 errors Pin
Richard MacCutchan28-Mar-10 5:59
mveRichard MacCutchan28-Mar-10 5:59 
GeneralRe: LNK2001 and LNK2019 errors Pin
Krzysiaczek9928-Mar-10 8:07
Krzysiaczek9928-Mar-10 8:07 
GeneralRe: LNK2001 and LNK2019 errors Pin
Richard MacCutchan28-Mar-10 11:34
mveRichard MacCutchan28-Mar-10 11:34 
GeneralRe: LNK2001 and LNK2019 errors [modified] Pin
Krzysiaczek9928-Mar-10 13:16
Krzysiaczek9928-Mar-10 13:16 
GeneralRe: LNK2001 and LNK2019 errors Pin
Richard MacCutchan28-Mar-10 23:03
mveRichard MacCutchan28-Mar-10 23:03 
GeneralRe: LNK2001 and LNK2019 errors Pin
Krzysiaczek9928-Mar-10 23:36
Krzysiaczek9928-Mar-10 23:36 
AnswerRe: LNK2001 and LNK2019 errors Pin
T210228-Mar-10 22:03
T210228-Mar-10 22:03 
GeneralRe: LNK2001 and LNK2019 errors Pin
Krzysiaczek9928-Mar-10 23:24
Krzysiaczek9928-Mar-10 23:24 
QuestionVB6 Project to VC6 Pin
MikeRWinter27-Mar-10 12:06
MikeRWinter27-Mar-10 12:06 
AnswerRe: VB6 Project to VC6 Pin
Richard Andrew x6427-Mar-10 13:07
professionalRichard Andrew x6427-Mar-10 13:07 
GeneralRe: VB6 Project to VC6 Pin
MikeRWinter27-Mar-10 13:49
MikeRWinter27-Mar-10 13:49 
GeneralRe: VB6 Project to VC6 Pin
Richard Andrew x6427-Mar-10 13:53
professionalRichard Andrew x6427-Mar-10 13:53 
GeneralRe: VB6 Project to VC6 Pin
MikeRWinter27-Mar-10 14:02
MikeRWinter27-Mar-10 14:02 
GeneralRe: VB6 Project to VC6 Pin
MikeRWinter27-Mar-10 15:41
MikeRWinter27-Mar-10 15:41 
GeneralRe: VB6 Project to VC6 Pin
Richard Andrew x6427-Mar-10 16:23
professionalRichard Andrew x6427-Mar-10 16:23 
QuestionReadFile (reading COM port) returns are different in debug – stepping thru and run. [modified] SOLVED Pin
Vaclav_27-Mar-10 9:54
Vaclav_27-Mar-10 9:54 
I am trying to figure out why ReadFile returns different values when I step thru the program and when I run it. Both in debug mode. I am using ReadFile to get data from COM port.

When stepping thru it returns expected ERROR_IO_PENDING, but when running it returns “The system cannot find the file specified”.

I am checking for ERROR_IO_PENDING and do GetLastError when it fails.
The GetLastError returns the above missing file message.

I can do WaitForSingleObject using timeout. I do not have my program finished so I cannot actually do any real data reading from the COM port.
My guess is that I have some error in my setup and the ERROR_IO_PENDING message is masking it.
Any constructive comments as always are appreciated.
Thank you for your time.
Vaclav


Update

I found one error in my setup - the receiving buffer size was not defined.
Now I am getting the “The system cannot find the file specified” all the time - consitently. I think I can fix it now.

Solution / lesson learned :
When using an API which has GetLastError option use it before you do any API return value processing. My ill-conceived program logic - checking the return value first - got me into trouble.


-- Modified Sunday, March 28, 2010 10:47 AM
AnswerRe: ReadFile (reading COM port) returns are different in debug – stepping thru and run. Pin
CPallini27-Mar-10 11:28
mveCPallini27-Mar-10 11:28 
GeneralRe: ReadFile (reading COM port) returns are different in debug – stepping thru and run. Pin
Vaclav_27-Mar-10 15:53
Vaclav_27-Mar-10 15:53 
QuestionHow to work sqlite in vc++ Pin
kirancgi27-Mar-10 4:51
kirancgi27-Mar-10 4:51 
AnswerRe: How to work sqlite in vc++ Pin
loyal ginger27-Mar-10 5:01
loyal ginger27-Mar-10 5:01 

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.