当前位置: 首页>>代码示例>>C++>>正文


C++ ITypeInfo::GetTypeComp方法代码示例

本文整理汇总了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;
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:59,代码来源:PyIType.cpp

示例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);
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:13,代码来源:PyIType.cpp


注:本文中的ITypeInfo::GetTypeComp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。