If I needed to translate to types in the Delphi framework, I would use:
WinAPI DataType | Delphi Translated DataType | Automation Object Compatible DataType DWORD | Cardinal | ?????
WinAPI DataType | Delphi Translated DataType | Automation Object Compatible DataType HANDLE(HWND) | HWND | ?????
However, I need to translate these types to pass them via a COM (type library) interface.
Which are the correct types should I use?
Note: The types needs to be 100% compatible with automation objects.
Choose one from Automation-compatible types.
SYSUINT
(ie. VT_UINT
, unsigned int
) seem to be your best bet for both if the target platform includes both 32-bit and 64-bit architectures. For 32-bit-only, you can choose LongWord
(VT_UI4
).
If you don't need an automation-compatible COM library you can also choose Pointer
for THandle
.