On 11/18/21 7:43 PM, Gabriel Ivăncescu wrote:
- case VT_DISPATCH: {
LCID lcid = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT);
IDispatch *disp = V_DISPATCH(v);
if(!disp) {
nsAString_InitDepend(nsstr, NULL);
return S_OK;
}
hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, lcid, DISPATCH_PROPERTYGET, NULL, &var, NULL, NULL);
if(FAILED(hres))
return hres;
if(V_VT(&var) == VT_BSTR) {
nsAString_Init(nsstr, V_BSTR(&var));
SysFreeString(V_BSTR(&var));
break;
}
if(V_VT(&var) == (VT_BSTR | VT_BYREF)) {
nsAString_Init(nsstr, *V_BSTRREF(&var));
break;
}
hres = variant_to_nsstr(&var, hex_int, nsstr);
VariantClear(&var);
return hres;
Could you just use the same implementation as VT_R8 in this case? VariantChangeTypeEx should what you need.
Thanks,
Jacek