Some of the methods of a COM interface, which I have imported from a type library (part of a hardware SDK), return or receive a value of type IUnknown. As an example, the SDK documentation specifies the methods as follows:
bool SetInput1Selection(InputSelection inputSelection)
InputSelection GetInput1Selection()
But Delphi imported those methods like this:
function SetInput1Selection(const inputSelection: IUnknown): WordBool; safecall;
function GetInput1Selection: IUnknown; safecall;
The type InputSelection seems to be a simple integer or enum type, but is not specified anywhere. The documentation only gives a table of the 14 different possible values, as well as their meaning.
Ideally, I would like to declare my own type:
TInputSelection = (isCustom, isStartReset, ...)
Here is how the type library defines these functions:
virtual HRESULT __stdcall SetInput1Selection (/*[in]*/ IUnknown * inputSelection, /*[out,retval]*/ VARIANT_BOOL * pRetVal ) = 0;
virtual HRESULT __stdcall GetInput1Selection (/*[out,retval]*/ IUnknown * * pRetVal ) = 0;
But how can I make this work?