| 422 | } |
| 423 | |
| 424 | std::wstring VariantUtilities::GetVariantObjectTypeName(VARIANT value) { |
| 425 | std::wstring name = L""; |
| 426 | if (value.vt == VT_DISPATCH && value.pdispVal) { |
| 427 | CComPtr<ITypeInfo> typeinfo; |
| 428 | HRESULT get_type_info_result = value.pdispVal->GetTypeInfo(0, |
| 429 | LOCALE_USER_DEFAULT, |
| 430 | &typeinfo); |
| 431 | TYPEATTR* type_attr; |
| 432 | CComBSTR name_bstr; |
| 433 | if (SUCCEEDED(get_type_info_result) && |
| 434 | SUCCEEDED(typeinfo->GetTypeAttr(&type_attr)) && |
| 435 | SUCCEEDED(typeinfo->GetDocumentation(-1, &name_bstr, 0, 0, 0))) { |
| 436 | typeinfo->ReleaseTypeAttr(type_attr); |
| 437 | name = name_bstr.Copy(); |
| 438 | } else { |
| 439 | LOG(WARN) << "Unable to get object type"; |
| 440 | } |
| 441 | } else { |
| 442 | LOG(DEBUG) << "Unable to get object type for non-object result, result is not IDispatch or IDispatch pointer is NULL"; |
| 443 | } |
| 444 | return name; |
| 445 | } |
| 446 | |
| 447 | int VariantUtilities::GetPropertyNameList(IDispatch* object_dispatch, |
| 448 | std::vector<std::wstring>* property_names) { |
nothing calls this directly
no test coverage detected