Search code examples
delphi

Is the wrong data type referenced?


When I write GetLastError and hit Ctrl + Space it get the hint popup.

hint popup

There are two GetLastErrors. If I am correct, one is in System.pas and declared as function GetLastError: Integer; {$IFDEF MSWINDOWS} stdcall; {$ENDIF} and one is in Winapi.Windows declared as function GetLastError: DWORD; stdcall;

Where does the Cardinal data type come from? Case for Emba Support? What am I missing?

I have the uses of interface and implementation that are generated by a new TForm/Windows VCL Application - Delphi.

I am using Delphi 11 with Update 2.


Solution

  • Where does the Cardinal data type come from?

    DWORD is an alias for Cardinal. It is available in the System and System.Types units.

    The popup is showing you the actual data types, not the aliased types.