I am migrating my Delphi 5 application to Delphi XE3. I am getting some erros while compiling it. Can someone please help me to resolve these. Thanks for help in advance.
I am not able to find defination of function
OemToChar
in XE3. When I Ctrl+Click on that function it shows messageUnable to locate 'WinAPI.Windows.pas'
. I am not able to open any delphi component file. What is the location of windows.pas located on the system ? or How to resolve it ?Incompatiable Types: 'PAnsiChar' and 'PWideChar'
in below function on line withOemToChar(p1, p2)
.
function OemToAnsi(const Str: string): string;
var
p1,
p2: PChar;
begin
p1 := PChar(Str);
p2 := StrNew(p1);
OemToChar(p1, p2);
Result := StrPas(p2);
StrDispose(p2);
end;
- Getting error
'Low Bound Exceeds High Bound'
in following code.
function StrToRichText(const Str: string): string;
var
i: integer;
begin
Result := '';
for i := 1 to Length(Str) do
begin
case Str[i] of
#128 .. #255 :
Result := Result + '\''' + LowerCase(IntToHex(Ord(Str[i]), 2));
'\','{','}':
Result := Result + '\' + Str[i];
else
Result := Result + Str[i];
end;
end;
end;