MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / GetVariantObjectTypeName

Method GetVariantObjectTypeName

cpp/iedriver/VariantUtilities.cpp:424–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424std::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
447int VariantUtilities::GetPropertyNameList(IDispatch* object_dispatch,
448 std::vector<std::wstring>* property_names) {

Callers

nothing calls this directly

Calls 3

GetTypeInfoMethod · 0.80
LOGClass · 0.50
CopyMethod · 0.45

Tested by

no test coverage detected