Click here to Skip to main content
15,900,254 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionheader file Pin
khomeyni16-Jan-10 9:15
khomeyni16-Jan-10 9:15 
AnswerRe: header file Pin
Chris Losinger16-Jan-10 9:47
professionalChris Losinger16-Jan-10 9:47 
AnswerRe: header file Pin
CPallini16-Jan-10 10:26
mveCPallini16-Jan-10 10:26 
AnswerRe: header file Pin
Stuart Dootson16-Jan-10 11:10
professionalStuart Dootson16-Jan-10 11:10 
GeneralRe: header file Pin
khomeyni18-Jan-10 8:50
khomeyni18-Jan-10 8:50 
QuestionHow can generate service from exe? Pin
Le@rner15-Jan-10 19:58
Le@rner15-Jan-10 19:58 
AnswerRe: How can generate service from exe? Pin
Garth J Lancaster15-Jan-10 22:36
professionalGarth J Lancaster15-Jan-10 22:36 
GeneralRe: How can generate service from exe? Pin
Le@rner16-Jan-10 0:43
Le@rner16-Jan-10 0:43 
GeneralRe: How can generate service from exe? Pin
JudyL_MD16-Jan-10 2:55
JudyL_MD16-Jan-10 2:55 
AnswerRe: How can generate service from exe? Pin
loyal ginger16-Jan-10 2:28
loyal ginger16-Jan-10 2:28 
QuestionCButton GetState , how to read the press and hold state of a button? Pin
timbk15-Jan-10 11:45
timbk15-Jan-10 11:45 
AnswerRe: CButton GetState , how to read the press and hold state of a button? Pin
Hamid_RT15-Jan-10 20:26
Hamid_RT15-Jan-10 20:26 
GeneralRe: CButton GetState , how to read the press and hold state of a button? Pin
timbk16-Jan-10 11:18
timbk16-Jan-10 11:18 
AnswerRe: CButton GetState , how to read the press and hold state of a button? Pin
Rozis16-Jan-10 10:17
Rozis16-Jan-10 10:17 
Questionsystem call too small Pin
2buck5615-Jan-10 10:36
2buck5615-Jan-10 10:36 
AnswerRe: system call too small Pin
CPallini15-Jan-10 10:44
mveCPallini15-Jan-10 10:44 
GeneralRe: system call too small Pin
2buck5615-Jan-10 11:36
2buck5615-Jan-10 11:36 
GeneralRe: system call too small Pin
LunaticFringe15-Jan-10 11:44
LunaticFringe15-Jan-10 11:44 
GeneralRe: system call too small Pin
2buck5615-Jan-10 12:26
2buck5615-Jan-10 12:26 
GeneralRe: system call too small Pin
Garth J Lancaster15-Jan-10 12:49
professionalGarth J Lancaster15-Jan-10 12:49 
GeneralRe: system call too small Pin
LunaticFringe15-Jan-10 13:01
LunaticFringe15-Jan-10 13:01 
Think about it. GetLastError returns valid information only when the API call immediately preceding it fails. If the call preceding it succeeds, the information returned is meaningless.

So what do you do with your two lines of code? Call SetLastError, which, in all likelihood, succeeds; then you call GetLastError.

L u n a t i c F r i n g e

GeneralRe: system call too small Pin
2buck5615-Jan-10 13:51
2buck5615-Jan-10 13:51 
GeneralRe: system call too small [modified] Pin
LunaticFringe15-Jan-10 14:31
LunaticFringe15-Jan-10 14:31 
GeneralRe: system call too small Pin
2buck5615-Jan-10 15:02
2buck5615-Jan-10 15:02 
GeneralRe: system call too small Pin
CPallini15-Jan-10 22:02
mveCPallini15-Jan-10 22:02 

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.