Re: Exception and GetLastError()

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"hangaround" <hangaround@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C86528AA-24C4-4AA5-90AB-30A7FA0064A3@xxxxxxxxxxxxxxxx
Hi there:
look at code blow
////////////////////
try
{
blah blah blah
}catch(...)
{
DWORD dw = GetLastError()
}
////////////////////

Does it make sence to call GetLastError() in catch block?
In my opinion, I dont think it's necesary do like above, but could sure
about it.

There is not enough information to say with certainty if the last error
would be meaningful at all. That's because some functions do not clear the
error code in advance and in the case where the function succeeds the value
is stale.

Regards,
Will



.



Relevant Pages

  • Re: Exception and GetLastError()
    ... blah blah blah ... Does it make sence to call GetLastError() in catch block? ... If you want to catch any error to do some error logging you should put a throw; at the end of the catch block so that the exception is rethrown and a debugger or DrWatson can catch an report it, e.g. as a mini dump. ...
    (microsoft.public.vc.language)
  • Setup failed while installing Admin Group 0x80071392
    ... Setup failed while installing sub-component Administrative Group with error code 0x80071392 (blah blah try again...) ... Entering ScCreateTLH ... Entering ScQueueWatsonErrorReport ...
    (microsoft.public.exchange.setup)
  • Re: Dungeon Seige:LoA trouble
    ... | getting tired of the Welcome screen password set-up, ... | Param 2: 0 ...
    (microsoft.public.games)
  • exit status
    ... I am attempting to return an error code from a Perl script. ... At first blush, ... exit(status(<blah blah blah>)); ...
    (comp.lang.perl.misc)
  • Re: exit status
    ... I am attempting to return an error code from a Perl script. ... At first blush, ... exit(status(<blah blah blah>)); ... How do you test the value of exit code? ...
    (comp.lang.perl.misc)