Logged In: NO

You could try this also:

function SysErrorMessage_2(ErrorCode: Integer): string;
var
Len: Integer;
Buffer: array[0..2550] of Char;
S_english, S_deutsch : String;
begin //SUBLANG_SYS_DEFAULT
Len := FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM or
FORMAT_MESSAGE_ARGUMENT_ARRAY, nil, ErrorCode,
LANG_NEUTRAL or (SUBLANG_DEFAULT shl 10), Buffer,
SizeOf(Buffer), nil);
while (Len > 0) and (Buffer[Len - 1] in [#0..#32, '.']) do
Dec(Len);
SetString(S_english, Buffer, Len);
Len := FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM or
FORMAT_MESSAGE_ARGUMENT_ARRAY, nil, ErrorCode,
LANG_NEUTRAL or (SUBLANG_SYS_DEFAULT shl 10), Buffer,
SizeOf(Buffer), nil);
while (Len > 0) and (Buffer[Len - 1] in [#0..#32, '.']) do
Dec(Len);
SetString(S_deutsch, Buffer, Len);
Result := 'EN: ' + S_english +#13#10+ 'DE: ' + S_deutsch;
end;

// create exception with windows error code
constructor EComPort.Create(ACode: Integer; AWinCode: Integer);
begin
FWinCode := AWinCode;
FCode := ACode;
inherited CreateFmt(ComErrorMessages[ACode] + ' (win error
code: %d)'
+ #13#10 + SysErrorMessage_2(AWinCode), [AWinCode]);
end;