Hello,
In activex.pp, the GetMarshalSizeMax method is defined as:
Function GetMarshalSizeMax ( Const Riid: TIID; {in, unique} pv:Pointer; Const dwDestContext : DWord;
{in, unique} pvDestContext:Pointer; Const mshlflags : DWord; out pSize : PDWord ): HResult;Stdcall;
Note the last parameter is declared as "out pSize : PDWord" since it is "out", it should be declared as "out pSize : DWord" (no P in DWord).
HTH.