Partially working InvokeHelper code generator for C.
It needs lot of fixing, but can create a templates for functions/methods.
Create code like this:int _DSynMhAtx_AddPolyLine(IDispatch *pDisp,BSTR strObjectName,short nPts,float* x,int bClosed)
{
if (!pDisp) return;
DISPPARAMS dp;
VARIANT vResult;
VariantInit(&vResult);
VARIANT vParams[4];
vParams[3].vt = VT_BSTR;
vParams[3].bstrVal = strObjectName;
vParams[2].vt = VT_I2;
vParams[2].iVal = nPts;
vParams[1].vt = VT_R4 | VT_BYREF;
vParams[1].pfltVal = x;
vParams[0].vt = VT_I4;
vParams[0].intVal = bClosed;
dp.cNamedArgs = 0;
dp.rgdispidNamedArgs = NULL;
dp.cArgs = 4;
dp.rgvarg = &vParams[0];
pDisp->lpVtbl->Invoke(pDisp, 0x33, &IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD, &dp, &vResult, NULL, NULL);
//SysFreeString(vParams[3].bstrVal);
return vResult.intVal;
}
Hopefully it helps someone with similar issues.