Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Casting with TULargeInteger in delphi 10.2 Tokyo differ from previous version

Casting with TULargeInteger with new compiler 10.2 missing attribut LowPart and HighPart.

uses Winapi.Windows;

    function RetLargeInt: Int64;
    var
      ALow: DWORD;

    begin
      {Do Something
        With ALow
      }
      TULargeInteger(Result).LowPart := ALow; {Missing 'LowPart'}
    end;

    procedure AProc;
    var
     ALocalInt: Int64;
    begin
      ALocalInt := RetLargeInt;
      {Do Something}
    end;
like image 563
Dicky Tamara Avatar asked Nov 29 '25 11:11

Dicky Tamara


1 Answers

In 10.2 Tokyo, the declaration of TULargeInteger has changed from:

TULargeInteger = ULARGE_INTEGER;

to :

TULargeInteger = UInt64;

This means that you can no longer access the ULARGE_INTEGER record fields that exposes LowPart.

ULARGE_INTEGER = record
    case Integer of
    0: (
      LowPart: DWORD;
      HighPart: DWORD);
    1: (
      QuadPart: ULONGLONG);
  end;

You can change the code to use ULARGE_INTEGER instead:

ULARGE_INTEGER(Result).LowPart := ALow;
like image 98
LU RD Avatar answered Dec 01 '25 09:12

LU RD



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!