我正在将Delphi 5应用程序迁移到Delphi XE3。我在编译时遇到了一些错误。有人可以帮助我解决这些问题吗?提前感谢您的帮助。如何解决Delphi XE3迁移错误?
我无法在XE3中找到函数
OemToChar
的定义。当我按Ctrl +点击该功能时,它显示消息Unable to locate 'WinAPI.Windows.pas'
。我无法打开任何delphi组件文件。系统上windows.pas的位置是什么?或如何解决它?Incompatiable Types: 'PAnsiChar' and 'PWideChar'
以下功能符合OemToChar(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;
- 得到错误
'Low Bound Exceeds High Bound'
在下面的代码。
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;
谢谢大卫。以上所有错误都解决了我肯定会阅读那篇论文。 – Nalu