소스 검색

* Fixed compilation (mantis #22413)

git-svn-id: trunk@21891 -
michael 13 년 전
부모
커밋
1f25547903
1개의 변경된 파일7개의 추가작업 그리고 8개의 파일을 삭제
  1. 7 8
      rtl/win/dynlibs.inc

+ 7 - 8
rtl/win/dynlibs.inc

@@ -57,16 +57,15 @@ end;
 Function GetLoadErrorStr: string;
 
 Var
-  rc : integer;
+  rc,c : integer;
+  
 begin  
   rc := GetLastError;
-  try
-    result := Trim(SysErrorMessage(rc));
-    if (result='') then
-      result := 'Operating system error 0x' + IntToHex(rc, 8) + ' (no descriptive text)'
-  except
-    result := 'Operating system error 0x' + IntToHex(rc, 8) + ' (error getting descriptive text)'
-  end;
+  SetLength(Result,255);
+  C:=FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM,nil,rc,
+                 MakeLangId(LANG_NEUTRAL, SUBLANG_DEFAULT),
+                 @Result[1], 255,nil);
+  SetLength(Result,c);
 end;
 
 {$endif}