- - * - WhiteUnicorn - * - -




* #WhiteUnicorn/ StartPage/ Documentation/DelphiFAQ >


Frequently Asked Questions

Getting a string representation of a Windows error code

Question:

How can I get a string representation of the last Windows error value returned by the Windows GetLastError?

Answer:

Use the RTL function SysErrorMessage(GetLastError).

Example:

procedure TForm1.Button1Click(Sender: TObject);
begin
 {Cause a Windows system error message to be logged}
  ShowMessage(IntToStr(lStrLen(nil)));
  ShowMessage(SysErrorMessage(GetLastError));
end;



* #WhiteUnicorn/ StartPage/ Documentation/DelphiFAQ >



- - * - Anastasija aka WhiteUnicorn - * - - LJLiveJournal
PFPhotoFile