Click here to Skip to main content
15,903,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCFile::GetFilePath() setting error Pin
Jamie Hale10-Sep-03 7:03
Jamie Hale10-Sep-03 7:03 
GeneralRe: CFile::GetFilePath() setting error Pin
David Crow10-Sep-03 7:23
David Crow10-Sep-03 7:23 
GeneralRe: CFile::GetFilePath() setting error Pin
Jamie Hale10-Sep-03 7:32
Jamie Hale10-Sep-03 7:32 
GeneralRe: CFile::GetFilePath() setting error Pin
David Crow10-Sep-03 7:47
David Crow10-Sep-03 7:47 
GeneralRe: CFile::GetFilePath() setting error Pin
Jamie Hale10-Sep-03 7:53
Jamie Hale10-Sep-03 7:53 
GeneralRe: CFile::GetFilePath() setting error Pin
David Crow10-Sep-03 8:00
David Crow10-Sep-03 8:00 
GeneralRe: CFile::GetFilePath() setting error Pin
Jamie Hale10-Sep-03 8:32
Jamie Hale10-Sep-03 8:32 
GeneralRe: CFile::GetFilePath() setting error Pin
David Crow10-Sep-03 10:05
David Crow10-Sep-03 10:05 
Jamie Hale wrote:
...a GetLastError() call later in the process was giving the error code...

So could SetLastError() be getting called long after GetFilePath() has come and gone?

For example, I've see instances of this type of code:

MyLoggingFunction("%d\n", SomeFunction());
DWORD dw = GetLastError();

One of two things can happen here. SomeFunction() could internally call SetLastError(0) but the above call to GetLastError() could be non-zero if MyLoggingFunction() called SetLastError(). Or, SomeFunction() could call SetLastError() with a non-zero value, but by the time MyLoggingFunction() had finished, GetLastError() is 0. Make sense?


Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?

GeneralRe: CFile::GetFilePath() setting error Pin
Jamie Hale10-Sep-03 10:26
Jamie Hale10-Sep-03 10:26 
GeneralRe: CFile::GetFilePath() setting error Pin
David Crow10-Sep-03 10:38
David Crow10-Sep-03 10:38 
GeneralRe: CFile::GetFilePath() setting error Pin
Jamie Hale10-Sep-03 10:46
Jamie Hale10-Sep-03 10:46 
GeneralRe: CFile::GetFilePath() setting error Pin
David Crow11-Sep-03 2:27
David Crow11-Sep-03 2:27 
GeneralRe: CFile::GetFilePath() setting error Pin
Alvaro Mendez10-Sep-03 8:13
Alvaro Mendez10-Sep-03 8:13 
GeneralRe: CFile::GetFilePath() setting error Pin
Jamie Hale10-Sep-03 8:33
Jamie Hale10-Sep-03 8:33 
GeneralCOM port Access Pin
wogerdoger10-Sep-03 6:54
wogerdoger10-Sep-03 6:54 
GeneralRe: COM port Access Pin
Anonymous10-Sep-03 8:01
Anonymous10-Sep-03 8:01 
GeneralRe: COM port Access Pin
wogerdoger10-Sep-03 12:31
wogerdoger10-Sep-03 12:31 
GeneralRe: COM port Access Pin
DarkMarine11-Sep-03 8:18
DarkMarine11-Sep-03 8:18 
QuestionHow to catch an exception in dll? Pin
Eugene Pustovoyt10-Sep-03 6:43
Eugene Pustovoyt10-Sep-03 6:43 
AnswerRe: How to catch an exception in dll? Pin
David Crow10-Sep-03 6:52
David Crow10-Sep-03 6:52 
GeneralRe: How to catch an exception in dll? Pin
Eugene Pustovoyt10-Sep-03 7:57
Eugene Pustovoyt10-Sep-03 7:57 
GeneralRe: How to catch an exception in dll? Pin
David Crow10-Sep-03 8:02
David Crow10-Sep-03 8:02 
GeneralRe: How to catch an exception in dll? Pin
Alvaro Mendez10-Sep-03 8:23
Alvaro Mendez10-Sep-03 8:23 
AnswerRe: How to catch an exception in dll? Pin
Joel Lucsy10-Sep-03 11:19
Joel Lucsy10-Sep-03 11:19 
GeneralThanks to everybody. catch( ... ) works Pin
Eugene Pustovoyt10-Sep-03 18:03
Eugene Pustovoyt10-Sep-03 18:03 

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.