Hello,
In activex.pp, DebugServerQueryInterface is defined as follows:
Function DebugServerQueryInterface(CONST pv : Pointer):HResult; StdCall;
In C/C++ the definition is:
virtual HRESULT STDMETHODCALLTYPE DebugServerQueryInterface(
/* [annotation][out] */
_Outptr_ void **ppv) = 0;
Note that what is returned is a pointer to a pointer, not just a pointer as the Pascal definition has it. In addition to that, the parameter cannot possibly be "const" since "pv" is where the value is returned.
More precisely, what's returned is a pointer to an interface.