MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / Type

Method Type

source/script_com.cpp:1434–1454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1432
1433
1434LPTSTR ComObject::Type()
1435{
1436 if ((mVarType == VT_DISPATCH || mVarType == VT_UNKNOWN) && mUnknown)
1437 {
1438 BSTR name;
1439 ITypeInfo *ptinfo;
1440 // Use COM class name if available.
1441 if ( (ptinfo = GetClassTypeInfo(mUnknown))
1442 && SUCCEEDED(ptinfo->GetDocumentation(MEMBERID_NIL, &name, NULL, NULL, NULL)) )
1443 {
1444 static TCHAR sBuf[64]; // Seems generous enough.
1445 tcslcpy(sBuf, CStringTCharFromWCharIfNeeded(name), _countof(sBuf));
1446 SysFreeString(name);
1447 return sBuf;
1448 }
1449 }
1450 ExprTokenType value;
1451 if (Base()->GetOwnProp(value, _T("__Class")))
1452 return TokenToString(value);
1453 return _T("ComValue"); // Provide a safe default in case __Class was removed.
1454}
1455
1456
1457Object *ComObject::Base()

Callers

nothing calls this directly

Calls 3

GetClassTypeInfoFunction · 0.85
TokenToStringFunction · 0.85
GetOwnPropMethod · 0.80

Tested by

no test coverage detected