On Sat, 2003-11-08 at 12:41, Johannes Berg wrote:
> Here's a basic implementation that works for me (*):

And before someone complains about Delphi compatibility:

type
  EOSError = class(Exception)
  protected
    FErrorCode: Integer;
  public
    property ErrorCode: Integer read FErrorCode;
  end;

procedure RaiseLastOSError;
var
  LError: integer;
  LErrExc: EOSError;
begin
  LError := GetLastError;
  LErrExc := EOSError.CreateFmt(StrOSError,[LError,StrError(LError)]);
  LErrExc.FErrorCode := LError;
  raise LErrExc;
end;

johannes
-- 
http://www.sipsolutions.de/
GnuPG key: http://www.sipsolutions.de/keys/JohannesBerg.asc
  Key-ID: 9AB78CA5 Johannes Berg <[EMAIL PROTECTED]>
  Fingerprint = AD02 0176 4E29 C137 1DF6 08D2 FC44 CF86 9AB7 8CA5

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to