You shouldn't need the IDispatch* cast as that's the type of pdispVal (casts should not be used unnecessarily.)
Is the vt (VARTYPE) member of rgvarg set to VT_DISPATCH as you expect? (pdispVal is only valid if this is the case.)
What hr value is QueryInterface returning? Or is your code blowing up??
Last edited on
Thanks, it turns out that the parameters are in the reverse order, so rgvarg is the correct arg.