THandle

Top  Previous  Next

What is translated > Types > API Integration > THandle

THandle is an example for the API integration. THandle is defined in Winapi,Windows.pas as:

 

 

THandle = System.THandle;

 

System.pas defines:

 

  THandle = NativeUInt;

  {$NODEFINE THandle}

 

The NODEFINE directive is applied here, because for C++Builder there is a definition in Winapi.Windows.hpp:

 

typedef NativeUInt THandle;

 

For other compilers in Winapi.Windows.h this definition exists.

 

 

typedef System::THandle THandle;

 

 

But instead of defining it in Windows.h as NativeUInt, it si defined there as:

 

typedef HANDLE THandle;

 

Handle is defined in winnt.h as "void*". (If THandle were defined as NativeUInt = uint64_t.  HINSTANCE could not be assigned to it without cast.)

 

Like PByte also THandle is defined twice: one time inside of the System namespace and a second time as a global type. Therefore the translation works as well with API namespaces as with suppressed API namespaces;

 

 

 

 



This page belongs to the DelphiXE2Cpp11 Documentation

DelphiXE2Cpp11 home  Content