本文整理汇总了C++中ITypeInfo::GetRefTypeInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ ITypeInfo::GetRefTypeInfo方法的具体用法?C++ ITypeInfo::GetRefTypeInfo怎么用?C++ ITypeInfo::GetRefTypeInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITypeInfo
的用法示例。
在下文中一共展示了ITypeInfo::GetRefTypeInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PyCom_BuildPyException
PyObject *PyITypeInfo::GetRefTypeInfo(HREFTYPE href)
{
ITypeInfo *pti;
ITypeInfo *pMyTypeInfo = GetI(this);
if (pMyTypeInfo==NULL) return NULL;
PY_INTERFACE_PRECALL;
SCODE sc = pMyTypeInfo->GetRefTypeInfo(href, &pti);
PY_INTERFACE_POSTCALL;
if (FAILED(sc))
return PyCom_BuildPyException(sc, pMyTypeInfo, IID_ITypeInfo);
return new PyITypeInfo(pti);
}
示例2: makeTypeInfo
JNIEXPORT jobject JNICALL Java_org_racob_com_TypeInfo_getRefTypeInfo
(JNIEnv *env, jobject obj, jint pointer, jint reftype) {
ITypeInfo *typeInfo = (ITypeInfo *) pointer;
ITypeInfo *newTypeInfo = NULL;
HRESULT hr = typeInfo->GetRefTypeInfo(reftype, &newTypeInfo);
if (!SUCCEEDED(hr)) {
ThrowComFail(env, "getRefTypeInfo failed", hr);
return NULL;
}
return makeTypeInfo(env, newTypeInfo);
}
示例3: FindCLSID
CLSID tCOMUtil::FindCLSID(ITypeInfo* interface_typeinfo)
{
ITypeLib* ptypelib = NULL;
ITypeInfo* ptypeinfo = NULL;
long count = 0;
IID iid = IID_NULL;
TYPEATTR* ptypeattr = NULL;
TYPEKIND tkind;
bool found = false;
CLSID clsid = IID_NULL;
// gets IID
interface_typeinfo->GetTypeAttr(&ptypeattr);
iid = ptypeattr->guid;
interface_typeinfo->ReleaseTypeAttr(ptypeattr);
ptypeattr = NULL;
// Gets type library
interface_typeinfo->GetContainingTypeLib(&ptypelib, NULL);
// iterates looking for IID inside some coclass
count = ptypelib->GetTypeInfoCount();
while(count-- && !found)
{
ptypelib->GetTypeInfoType(count, &tkind);
if(tkind != TKIND_COCLASS)
continue;
// look inside
ptypelib->GetTypeInfo(count, &ptypeinfo);
// gets counts and clsid
ptypeinfo->GetTypeAttr(&ptypeattr);
long ifaces_count = ptypeattr->cImplTypes;
clsid = ptypeattr->guid;
ptypeinfo->ReleaseTypeAttr(ptypeattr);
ptypeattr = NULL;
TYPEFLAGS typeflags;
HREFTYPE RefType;
ITypeInfo* piface_typeinfo = NULL;
while(ifaces_count-- && !found)
{
ptypeinfo->GetRefTypeOfImplType(ifaces_count, &RefType);
ptypeinfo->GetRefTypeInfo(RefType, &piface_typeinfo);
piface_typeinfo->GetTypeAttr(&ptypeattr);
if(IsEqualIID(ptypeattr->guid, iid))
{
found = true;
}
piface_typeinfo->ReleaseTypeAttr(ptypeattr);
ptypeattr = NULL;
COM_RELEASE(piface_typeinfo);
}
COM_RELEASE(ptypeinfo);
}
COM_RELEASE(ptypelib);
return clsid;
}
示例4: ExpandTypeInfo
//.........这里部分代码省略.........
pti->AddRef() ;
tvis.item.cChildren = pattr->cVars ;
tvis.item.lParam = (LPARAM)pNewItem ;
tvis.item.pszText = _T("Properties") ;
tvis.item.iImage = typeProperties ;
tvis.item.iSelectedImage = tvis.item.iImage + 1 ;
m_pTree->InsertItem( &tvis ) ;
fExpand = TRUE ;
}
if (pattr->cFuncs)
{
pNewItem = new CTreeItem(m_pTree) ;
pNewItem->m_Type = typeMethods ;
pNewItem->SetTypeInfo(pti) ;
pti->AddRef() ;
tvis.item.cChildren = pattr->cFuncs ;
tvis.item.lParam = (LPARAM)pNewItem ;
tvis.item.pszText = _T("Methods") ;
tvis.item.iImage = typeMethods ;
tvis.item.iSelectedImage = tvis.item.iImage + 1 ;
m_pTree->InsertItem( &tvis ) ;
fExpand = TRUE ;
}
if (pattr->cImplTypes)
{
pNewItem = new CTreeItem(m_pTree) ;
pNewItem->m_Type = typeImplTypes ;
pNewItem->SetTypeInfo(pti) ;
pti->AddRef() ;
tvis.item.pszText = _T("Inherited Interfaces") ;
tvis.item.iImage = typeInterface ;
tvis.item.cChildren = pattr->cImplTypes ;
tvis.item.lParam = (LPARAM)pNewItem ;
tvis.item.iSelectedImage = tvis.item.iImage ;
m_pTree->InsertItem( &tvis ) ;
fExpand = TRUE ;
}
break ;
// [attributes]
// coclass classname {
// [attributes2] [interface | dispinterface] interfacename;
// ...
// };
case TKIND_COCLASS:
fExpand = ExpandImplTypes( hitem ) ;
break ;
// typedef [attributes] basetype aliasname;
case TKIND_ALIAS:
if (pattr->tdescAlias.vt == VT_USERDEFINED)
{
ITypeInfo* ptiRefType = NULL ;
#pragma warning (suppress: 6246)
HRESULT hr = pti->GetRefTypeInfo( pattr->tdescAlias.hreftype, &ptiRefType ) ;
if (FAILED(hr))
AfxThrowOleException( hr ) ;
pNewItem = new CTreeItem(m_pTree) ;
pNewItem->SetTypeInfo( ptiRefType ) ;
pNewItem->m_Type = TypeKindToItemType( pNewItem->GetTypeKind() ) ;
tvis.item.iImage = TypeKindToItemType( pNewItem->GetTypeKind() ) ;
tvis.item.cChildren = 1 ;
tvis.item.lParam = (LPARAM)pNewItem ;
tvis.item.iSelectedImage = tvis.item.iImage ;
CString sName;
pNewItem->GetName(sName, TRUE );
tvis.item.pszText = sName.GetBuffer(0) ;
m_pTree->InsertItem( &tvis ) ;
sName.ReleaseBuffer();
fExpand = TRUE ;
}
break ;
// typedef [attributes] union [tag] {
// memberlist
// } unionname;
case TKIND_UNION:
fExpand = ExpandVars( hitem ) ;
break ;
default:
break ;
}
if (pattr)
pti->ReleaseTypeAttr( pattr ) ;
}
CATCH(CException, pException)
{
ErrorMessage( strError, hr ) ;
if (pNewItem)
delete pNewItem ;
if (pattr)
pti->ReleaseTypeAttr( pattr ) ;
return FALSE ;
}