Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8977953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:29:35+00:00 2026-06-15T19:29:35+00:00

I am migrating my Delphi 5 application to Delphi XE3. I am getting some

  • 0

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.

  1. I am not able to find defination of function OemToChar in XE3. When I Ctrl+Click on that function it shows message Unable 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 ?

  2. Incompatiable Types: 'PAnsiChar' and 'PWideChar' in below function on line with 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;
  1. 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;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:29:36+00:00Added an answer on June 15, 2026 at 7:29 pm

    Your OemToAnsi function should look like this:

    function OemToAnsi(const Str: AnsiString): AnsiString;
    begin
      SetLength(Result, Length(Str));
      OemToCharA(PAnsiChar(Str), PAnsiChar(Result));
    end;
    

    But perhaps you’d be better with

    function OemToWide(const Str: AnsiString): string;
    begin
      SetLength(Result, Length(Str));
      OemToChar(PAnsiChar(Str), PChar(Result));
    end;
    

    As for your StrToRichText, that looks more difficult. It clearly only accepts ANSI input. If you want to stick with ANSI then just change the declaration to

    function StrToRichText(const Str: AnsiString): AnsiString;
    

    RTF is encoded with 7 bit ASCII. To make that function work with Unicode input you’d need to escape any characters with ordinal >= 128. The escaping is described, for example, on the Wikipedia Rich Text Format page. I’ll leave that as an exercise for you!


    Before you go much further you need to read Marco Cantù’s white paper: Delphi and Unicode.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am migrating my Delphi 5 application to Delphi XE3. I am totally new
We are migrating a pretty big application crafted in Delphi 5 (still getting customers
I am migrating an application written in Delphi 2007 .Net to Delphi Prism, which
I am migrating an application written in Delphi 2007 to Delphi Prism, which is
I'm migrating an old Delphi application (using ZeosDB) to Delphi XE2. I want to
While migrating a legacy application to spring security I got the following exception: org.springframework.beans.factory.BeanCreationException:
I'm migrating an old Delphi application that I wrote into C#. The application is
I am migrating to VB, so I need a little help: in Delphi I
We are migrating a server application from Delphi 7 to Delphi 2007 and having
I'm migrating a Delphi project from old Delphi 2.0 IDE to the new RAD

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.