delphi - Reset GetLastError value -


delphi xe.

in delphi help: "...calling function resets operating system error state..."

how reset current error on 0? i.e. getlasterror=0

example:

try // there error except showmessage(inttostr(getlasterror)); // ok, getlasterror<>0 end; .... // no errors .... // how reset current error on 0? showmessage(inttostr(getlasterror)); // again <> 0 

you should calling getlasterror when there has been error. windows api functions reset error 0 on success, won't. either way, should interrogate error state when need know recent error.

note there setlasterror method well, doesn't you; if set last error 0, of course getlasterror return 0.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -