本文整理汇总了C++中ITypeInfo::GetTypeComp方法的典型用法代码示例。如果您正苦于以下问题:C++ ITypeInfo::GetTypeComp方法的具体用法?C++ ITypeInfo::GetTypeComp怎么用?C++ ITypeInfo::GetTypeComp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITypeInfo
的用法示例。
在下文中一共展示了ITypeInfo::GetTypeComp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ITypeCompBind
static PyObject* ITypeCompBind( ITypeComp* pTC, OLECHAR* S, unsigned short w )
{
ITypeInfo* pI;
DESCKIND DK;
BINDPTR BP;
PyObject* ret;
unsigned long hashval = 0;
PY_INTERFACE_PRECALL;
#ifndef MS_WINCE
// appears in the headers for CE, but wont link!?
hashval = LHashValOfNameSys(SYS_WIN32,LOCALE_USER_DEFAULT,S);
#endif
SCODE sc = pTC->Bind(S, hashval,w, &pI, &DK, &BP);
PY_INTERFACE_POSTCALL;
if (FAILED(sc))
return PyCom_BuildPyException(sc);
switch(DK){
case DESCKIND_FUNCDESC:
ret = PyObject_FromFUNCDESC(BP.lpfuncdesc);
pI->ReleaseFuncDesc(BP.lpfuncdesc);
break;
case DESCKIND_VARDESC:
ret = PyObject_FromVARDESC(BP.lpvardesc);
pI->ReleaseVarDesc(BP.lpvardesc);
break;
case DESCKIND_TYPECOMP:
ret = PyCom_PyObjectFromIUnknown(BP.lptcomp, IID_ITypeComp, FALSE);
break;
case DESCKIND_IMPLICITAPPOBJ:
ITypeComp* pTC2;
pI->GetTypeComp(&pTC2);
ret = PyTuple_New(2);
if (ret) {
// NOTE: SET_ITEM consumes the refcounts.
PyTuple_SET_ITEM( ret, 0, PyObject_FromVARDESC(BP.lpvardesc) );
PyTuple_SET_ITEM( ret, 1, ITypeCompBind(pTC2,S,w) );
}
pTC2->Release();
pI->ReleaseVarDesc(BP.lpvardesc);
break;
case DESCKIND_NONE:
default:
Py_INCREF(Py_None);
ret = Py_None;
break;
}
if (pI)
pI->Release();
if (ret == NULL)
return NULL;
PyObject *real_ret = PyTuple_New(2);
if (real_ret==NULL)
return NULL;
// NOTE: SET_ITEM consumes the refcounts.
PyTuple_SET_ITEM(real_ret, 0, PyInt_FromLong(DK) );
PyTuple_SET_ITEM(real_ret, 1, ret );
return real_ret;
}
示例2: PyCom_BuildPyException
PyObject *PyITypeInfo::GetTypeComp()
{
ITypeInfo *pMyTypeInfo = GetI(this);
ITypeComp *ptc;
if (pMyTypeInfo==NULL) return NULL;
PY_INTERFACE_PRECALL;
SCODE sc = pMyTypeInfo->GetTypeComp(&ptc);
PY_INTERFACE_POSTCALL;
if (FAILED(sc))
return PyCom_BuildPyException(sc, pMyTypeInfo, IID_ITypeInfo);
return PyCom_PyObjectFromIUnknown(ptc, IID_ITypeComp);
}