本文整理汇总了C++中atl::CComPtr::GetContainingTypeLib方法的典型用法代码示例。如果您正苦于以下问题:C++ CComPtr::GetContainingTypeLib方法的具体用法?C++ CComPtr::GetContainingTypeLib怎么用?C++ CComPtr::GetContainingTypeLib使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atl::CComPtr
的用法示例。
在下文中一共展示了CComPtr::GetContainingTypeLib方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dumpTypeLibrary
void dumpTypeLibrary(IDispatch* dispatchToDump, std::wostream& toOutput)
{
toOutput << L"Start dumping!" << std::endl;
COMUTILS_RETURN_IF_FAILED_START;
UINT typeLibCount = 0;
COMUTILS_RETURN_IF_FAILED(dispatchToDump->GetTypeInfoCount(&typeLibCount), toOutput, L"Failed to get type count");
toOutput << "Type Library count: " << typeLibCount << std::endl;
if (typeLibCount == 0) return;
ATL::CComPtr<ITypeInfo> typeInfoOfObj = NULL;
COMUTILS_RETURN_IF_FAILED(dispatchToDump->GetTypeInfo(NULL, LOCALE_SYSTEM_DEFAULT, &typeInfoOfObj), toOutput, L"Failed to get type info");
toOutput << L"DEBUG: Got type info!" << std::endl;
toOutput << L"DEBUG: Ptr to ITypeLib: " << std::hex << (int)typeInfoOfObj.p << std::dec << std::endl;
ATL::CComPtr<ITypeLib> typeLibOfObj = NULL;
UINT index = 0;
COMUTILS_RETURN_IF_FAILED(typeInfoOfObj->GetContainingTypeLib(&typeLibOfObj, &index), toOutput, L"Failed to get type lib");
toOutput << "DEBUG: Got type lib with index " << index << std::endl;
/*
TYPEATTR* descriptor = NULL;
COMUTILS_RETURN_IF_FAILED(typeInfoOfObj->GetTypeAttr(&descriptor), toOutput, L"Failed to get descriptor!");
toOutput << L"DEBUG: Got descriptor!" << std::endl;
toOutput << std::hex << (UINT)descriptor << std::dec << std::endl;
dumpTYPEATTR(descriptor, toOutput);
typeInfoOfObj->ReleaseTypeAttr(descriptor);
toOutput << L"DEBUG: Released descriptor!" << std::endl;
*/
}