| 1432 | |
| 1433 | |
| 1434 | LPTSTR 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 | |
| 1457 | Object *ComObject::Base() |
nothing calls this directly
no test coverage detected