Cómo llamar correctamente IDispatch :: Invoke con un parámetro BSTR * requerido

Hay muchos ejemplos de cómo llamar a IDispatch :: Invoke con un parámetro BSTR *. Tengo esto trabajando con muchos otros parámetros "SomeType *" pero no importa lo que intente, obtengo HRESULT de Type Mismatch, E_OUTOFMEMORY o una violación de acceso. Me parece que estoy haciendo algo mal con la memoria, pero estoy siguiendo los diferentes ejemplos que he encontrado ... Como nota al margen, el final "[fuera] UINTEl argumento puArgErr "nunca se llena con el índice de argumento que está causando el problema. Sin embargo, sé que es el tercer argumento del tipo BSTR (He llamado con éxito a otro método que toma los 2 argumentos anteriores).

VARIANTARG* v = new VARIANTARG[3];
//...Init my first 2 args
//Code omitted for initializing args 1 and 2 and wrapping everything up to call IDispatch->Invoke

//... Variation 1
VariantInit(v[2]);
BSTR val = SysAllocString(L"");
v[2].vt = VT_BSTR | BT_BYREF;
v[2].pbstrVal = &val;
//When I wrap everything up in the call to IDispatch::Invoke 
//this yields a HRESULT of Type Mismatch

*

//...Variation 2
VariantInit(v[2]);
BSTR val = SysAllocString(L"");
v[2].vt = VT_BSTR | BT_BYREF;
v[2].bstrVal = val;
//When I wrap everything up in the call to IDispatch::Invoke 
//this yields a HRESULT of E_OUTOFMEMORY

*

//...Variation 3
VariantInit(v[2]);
BSTR val = SysAllocString(L"RandomStringLargerThanTheMethodWillPlaceInTheOutParam");
v[2].vt = VT_BSTR | BT_BYREF;
v[2].bstrVal = val;
//When I wrap everything up in the call to IDispatch::Invoke 
//this yields an access violation

*

//...Variation 4
VariantInit(v[2]);
BSTR val = 0;
v[2].vt = VT_BSTR | BT_BYREF;
v[2].bstrVal = val;
//When I wrap everything up in the call to IDispatch::Invoke 
//this yields and HRESULT of 0x800706f4 A null reference pointer 
//was passed to the stub. 

No entiendo por qué cuando sigo otros ejemplos de parámetros BTR * esto está sucediendo ... Además, tengo muchas otras llamadas exitosas a IDispatch :: Invoke, pero este BTR * me ha detenido.

DESESPERADO, POR FAVOR AYUDA!

Adición:

IDL es: [id (0x00000171)] short GetCategory (short nIndx, short * nCat, BSTR * bszName);

Respuestas a la pregunta(1)

Su respuesta a la pregunta