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 6714537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:30:27+00:00 2026-05-26T08:30:27+00:00

How would I recode this to compile on 64-bit for Delphi XE2? On the

  • 0

How would I recode this to compile on 64-bit for Delphi XE2?

On the first code I get an error size is too large over 2gb.

On the second, Invalid Typecast on: if int64(TMethod(FOnChangeOO[i1])) = int64(TMethod(changeEvent)) then

1)
TExtBool = (no, yes, other);

  TAByte          = array [0..maxInt      -1] of byte;
  TAShortInt      = array [0..maxInt      -1] of shortInt;
  TAChar          = array [0..maxInt div sizeOf(Char)-1] of Char;
  TAAnsiChar      = array [0..maxInt      -1] of AnsiChar;
  TAWideChar      = array [0..maxInt shr 1-1] of WideChar;
  TABoolean       = array [0..maxInt      -1] of boolean;
  TAExtBool       = array [0..maxInt      -1] of TExtBool;
  TAWord          = array [0..maxInt shr 1-1] of word;
  TASmallInt      = array [0..maxInt shr 1-1] of smallInt;
  TACardinal      = array [0..maxInt shr 2-1] of cardinal;
  TAInteger       = array [0..maxInt shr 2-1] of integer;
  TAPointer       = array [0..maxInt shr 2-1] of pointer;
  TAString        = array [0..maxInt shr 2-1] of string;
  TAAnsiString    = array [0..maxInt shr 2-1] of AnsiString;
  TAWideString    = array [0..maxInt shr 2-1] of WideString;
  TAUnicodeString = array [0..maxInt shr 2-1] of UnicodeString;
  TAIUnknown      = array [0..maxInt shr 2-1] of IUnknown;
  TAInt64         = array [0..maxInt shr 3-1] of int64;

2)

TMethod = record code, data: pointer; end;
  TIListChangeEventOO = procedure (const list: ICustomBasicList; const item: IBasic;
                                   beforeChange: boolean;
                                   changeType: TChangeType; oldIndex, index: integer) of object;
  ICustomBasicList = interface (IList) ['{EE6D35A0-5F85-11D3-A52D-00005A180D69}']
  TChangeType = (lctUnchanged, lctChanged, lctNew, lctDeleted);
 IBasic = interface ['{53F8CE42-2C8A-11D3-A52D-00005A180D69}']


procedure TICustomBasicList.RegisterChangeEvent(changeEvent: TIListChangeEventOO);
var i1 : integer;
begin
  FSection.Enter;
  try
    if CheckValid then begin
      for i1 := 0 to high(FOnChangeOO) do
        if int64(TMethod(FOnChangeOO[i1])) = int64(TMethod(changeEvent)) then
          exit;
      i1 := Length(FOnChangeOO);
      SetLength(FOnChangeOO, i1 + 1);
      FOnChangeOO[i1] := changeEvent;
    end;
  finally FSection.Leave end;
end;

function TICustomBasicList.UnregisterChangeEvent(changeEvent: TIListChangeEvent) : boolean;
var i1, i2 : integer;
begin
  result := false;
  FSection.Enter;
  try
    i2 := high(FOnChange);
    for i1 := i2 downto 0 do
      if @FOnChange[i1] = @changeEvent then begin
        FOnChange[i1] := FOnChange[i2];
        dec(i2);
        result := true;
        FSuccess := true;
      end;
    if result then SetLength(FOnChange, i2 + 1)
    else           SetLastError(ERROR_FILE_NOT_FOUND);
  finally FSection.Leave 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-05-26T08:30:27+00:00Added an answer on May 26, 2026 at 8:30 am

    1) Instead of “shr 1/2/3” you should always use SizeOf(T) because “shr 2 = div 4” is not equal to “div SizeOf(Pointer)” in 64 bit. The same for UnicodeString, WideString, IUnknown, …

    2) TMethod is a record with two pointers. In 32 bit, the two pointers need 8 bytes (32bit * 2). In 64 bit, the two pointers need 16 bytes (64bit * 2). And an Int64 can’t hold 128 bit. So you now have to compare the two fields directly instead of casting it.

    if (TMethod(FOnChangeOO[i1]).Data = TMethod(changeEvent).Data) and
       (TMethod(FOnChangeOO[i1]).Code = TMethod(changeEvent).Code) then
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Would a C++ CLI compiler be able to compile some large sets of C++
Yes, this is just a question i would like to get an answer on.
I'm looking over some previous developers code and I come across this line: location.href
Would having a nice little feature that makes it quicker to write code like
Would NTFS allocation blocks of 16KB or 32KB make compile time faster in comparison
I am looking to recode a large number of variables, and figure I can
First of all I'd welcome edits to the title of this question, I couldn't
This is a bit of an idiot question, so you'll have to forgive me,
index.php has this jquery code which loads notifications.inc.php into a div on the page
I have the following code : $id = $_GET['id']; // get the recod from

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.