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


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

本文整理汇总了C++中ITypeInfo::GetDocumentation方法的典型用法代码示例。如果您正苦于以下问题:C++ ITypeInfo::GetDocumentation方法的具体用法?C++ ITypeInfo::GetDocumentation怎么用?C++ ITypeInfo::GetDocumentation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITypeInfo的用法示例。


在下文中一共展示了ITypeInfo::GetDocumentation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PyCom_BuildPyException

PyObject *PyITypeInfo::GetDocumentation(MEMBERID id)
{
	BSTR name, docstring, helpfile;
	unsigned long helpctx;
	ITypeInfo *pMyTypeInfo = GetI(this);
	if (pMyTypeInfo==NULL) return NULL;

	PY_INTERFACE_PRECALL;
	SCODE sc = pMyTypeInfo->GetDocumentation(id, &name, &docstring, &helpctx, &helpfile);
	PY_INTERFACE_POSTCALL;
	if (FAILED(sc))
		return PyCom_BuildPyException(sc, pMyTypeInfo, IID_ITypeInfo);

	// NOTE - These BSTR's seem not to have a reasonable length.
	// Specifically, DAO3032 leaves crap at the end if we use
	// MakeBSTRToObj.
	PyObject *obName = MakeOLECHARToObj(name);
	PyObject *obDocstring = MakeOLECHARToObj(docstring);
	PyObject *obHelpfile = MakeOLECHARToObj(helpfile);

	PyObject *ret = Py_BuildValue("(OOiO)", obName, obDocstring, helpctx, obHelpfile);

	SysFreeString(name);
	Py_XDECREF(obName);
	SysFreeString(docstring);
	Py_XDECREF(obDocstring);
	SysFreeString(helpfile);
	Py_XDECREF(obHelpfile);

	return ret;
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:31,代码来源:PyIType.cpp

示例2: freeDocumentationStrings

  JNIEXPORT jobject JNICALL Java_org_racob_com_TypeInfo_getDocumentation
  (JNIEnv *env, jobject obj, jint pointer, jint index) {
   ITypeInfo *typeInfo = (ITypeInfo *) pointer;
   BSTR name;
   BSTR docString;
   unsigned long helpContext;
   BSTR helpFile;
   HRESULT hr = typeInfo->GetDocumentation(index, &name, &docString, &helpContext,
           &helpFile);
   if (!SUCCEEDED(hr)) {
      freeDocumentationStrings(name, docString, helpFile);
      ThrowComFail(env, "getDocumentation failed", hr);
      return NULL;
   }

   jclass autoClass = env->FindClass("org/racob/com/Documentation");
   jmethodID autoCons = env->GetMethodID(autoClass, "<init>",
           "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V");
   jobject newAuto = env->NewObject(autoClass, autoCons, makeString(env, name),
           makeString(env, docString), makeString(env, helpFile), helpContext);

   freeDocumentationStrings(name, docString, helpFile);

   return newAuto;
 }
开发者ID:enebo,项目名称:racob,代码行数:25,代码来源:TypeInfo.cpp

示例3: get_interfacename

static void get_interfacename( IUnknown *punk, VARIANT *vres )
{
	HRESULT hr;
	IDispatch *pDisp;
	ITypeInfo *pTI;
	BSTR bstr = NULL;
	hr = punk->QueryInterface( IID_IDispatch, (void **)&pDisp );
	if ( SUCCEEDED(hr) && pDisp != NULL ) {
		hr = pDisp->GetTypeInfo( 0, LOCALE_USER_DEFAULT, &pTI );
		if ( SUCCEEDED(hr) && pTI != NULL ) {
			hr = pTI->GetDocumentation( MEMBERID_NIL, &bstr, NULL, NULL, NULL );
			pTI->Release();
		}
		pDisp->Release();
	}
	if ( bstr == NULL ) {
		bstr = SysAllocString( L"" );
	}
	vres->bstrVal = bstr;
	vres->vt = VT_BSTR;
}
开发者ID:zakki,项目名称:openhsp,代码行数:21,代码来源:hspvar_comobj.cpp

示例4: get_coclassname

static void get_coclassname( IUnknown *punk, VARIANT *vres )
{
	HRESULT hr;
	IProvideClassInfo *pPCI;
	ITypeInfo *pTI;
	BSTR bstr = NULL;
	hr = punk->QueryInterface( IID_IProvideClassInfo, (void **)&pPCI );
	if ( SUCCEEDED(hr) && pPCI != NULL ) {
		hr = pPCI->GetClassInfo( &pTI );
		if ( SUCCEEDED(hr) && pTI != NULL ) {
			hr = pTI->GetDocumentation( MEMBERID_NIL, &bstr, NULL, NULL, NULL );
			pTI->Release();
		}
		pPCI->Release();
	}
	if ( bstr == NULL ) {
		bstr = SysAllocString( L"" );
	}
	vres->bstrVal = bstr;
	vres->vt = VT_BSTR;
}
开发者ID:zakki,项目名称:openhsp,代码行数:21,代码来源:hspvar_comobj.cpp

示例5: DumpComTypes

void DumpComTypes(ITypeLib* pTypeLib)
{
	// Dump out the types.
	USES_CONVERSION;
	pTypeLib->AddRef();
	ULONG typeCount = pTypeLib->GetTypeInfoCount();
	cout << "\n****** The COM Types ******" << endl;
	cout << "There are " << typeCount << " in this type lib" << endl << endl;

	for(ULONG typeIndex = 0; typeIndex < typeCount; typeIndex++)
	{
		ITypeInfo* pInfo = NULL;
		TYPEATTR* typeAtt;
		CComBSTR temp;
		ULONG index = 0;
		ULONG numbMembers = 0;

		pTypeLib->GetTypeInfo(typeIndex, &pInfo);
		pInfo->GetTypeAttr(&typeAtt);		

		// Based on the kind of COM type, print out some information. 
		switch(typeAtt->typekind)
		{
		case TKIND_COCLASS:  // type is a coclass.
			cout << "(" << typeIndex << ")" << " Coclass with " << typeAtt->cImplTypes << " interface(s). ******" << endl;
			temp = typeAtt->guid;
			cout << "->CLSID: " << W2A(temp.Copy()) << endl;
			pInfo->GetDocumentation(-1, &temp, NULL, NULL, NULL);
			cout << "->Name: " << W2A(temp.Copy()) << endl;
		break;

		case TKIND_DISPATCH:  // type is a IDispatch derived interface.
			cout << "(" << typeIndex << ")" << " IDispatch based interface with " << typeAtt->cFuncs << " method(s). ******" << endl;
			temp = typeAtt->guid;
			cout << "->IID: " << W2A(temp.Copy()) << endl;	
			pInfo->GetDocumentation(-1, &temp, NULL, NULL, NULL);
			cout << "->Name: " << W2A(temp.Copy()) << endl;
			
			numbMembers = typeAtt->cFuncs;
			for(index = 0; index < numbMembers; index++)
			{
				FUNCDESC* fx;
				pInfo->GetFuncDesc(index, &fx);
				pInfo->GetDocumentation(fx->memid, &temp, NULL, NULL, NULL);
				cout << "  ->" << W2A(temp.Copy()) << " has " << fx->cParams << " params" << endl;
				pInfo->ReleaseFuncDesc(fx);
			}			
		break;

		case TKIND_INTERFACE: // Type is an IUnknown derived interface.
			cout << "(" << typeIndex << ")" << " IUnknown based interface with " << typeAtt->cFuncs << " method(s). ******" << endl;
			temp = typeAtt->guid;
			cout << "->IID: " << W2A(temp.Copy()) << endl;			
			pInfo->GetDocumentation(-1, &temp, NULL, NULL, NULL);
			cout << "->Name: " << W2A(temp.Copy()) << endl;
			
			numbMembers = typeAtt->cFuncs;
			for(index = 0; index < numbMembers; index++)
			{
				FUNCDESC* fx;
				pInfo->GetFuncDesc(index, &fx);
				pInfo->GetDocumentation(fx->memid, &temp, NULL, NULL, NULL);
				cout << "  ->" << W2A(temp.Copy()) << " has " << fx->cParams << " param(s)" << endl;
				pInfo->ReleaseFuncDesc(fx);
			}			
		break;

		case TKIND_ENUM:  // Type is an enum.
			cout << "(" << typeIndex << ")" << " Enum with " << typeAtt->cVars << " member(s). ******" << endl;
			pInfo->GetDocumentation(-1, &temp, NULL, NULL, NULL);
			cout << "->Name: " << W2A(temp.Copy()) << endl;
			
			numbMembers = typeAtt->cVars;
			for(index = 0; index < numbMembers; index++)
			{
				VARDESC* var;
				pInfo->GetVarDesc(index, &var);
				pInfo->GetDocumentation(var->memid, &temp, NULL, NULL, NULL);				 
				cout << "  ->" << W2A(temp.Copy()) << endl;
				pInfo->ReleaseVarDesc(var);
			}
		break;
		
		default:
			cout << "Some other type I don't care about..." << endl;

		}
		cout << endl;
		pInfo->ReleaseTypeAttr(typeAtt);
		pInfo->Release();
	}
	pTypeLib->Release();
}
开发者ID:rojac07,项目名称:COM,代码行数:93,代码来源:CppComTypeReader.cpp


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