• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ InvokeViaPolicy函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中InvokeViaPolicy函数的典型用法代码示例。如果您正苦于以下问题:C++ InvokeViaPolicy函数的具体用法?C++ InvokeViaPolicy怎么用?C++ InvokeViaPolicy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: GetControlWindow

STDMETHODIMP PyGShellBrowser::GetControlWindow(
		/* [in] */ UINT id,
		/* [out] */ HWND * phwnd)
{
	static const char *method_name = "GetControlWindow";
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy(method_name, &result, "I", id);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	if (!PyWinObject_AsHANDLE(result, (HANDLE *)phwnd))
		hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name);
	Py_DECREF(result);
	return hr;
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:15,代码来源:PyIShellBrowser.cpp


示例2: OnDefWindowMessage

STDMETHODIMP PyGOleInPlaceSiteWindowless::OnDefWindowMessage(
		/* [in] */ UINT msg,
		/* [in] */ WPARAM wParam,
		/* [in] */ LPARAM lParam,
		/* [out] */ LRESULT __RPC_FAR * plResult)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("OnDefWindowMessage", &result, "iil", msg, wParam, lParam);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	if (!PyArg_Parse(result, "l" , plResult)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:15,代码来源:PyIOleInPlaceSiteWindowless.cpp


示例3: PyLong_FromUnsignedLongLong

// @pymethod |PyIEmptyVolumeCache|Purge|
STDMETHODIMP PyGEmptyVolumeCache::Purge(
		/* [in] */ DWORDLONG dwlSpaceToFree,
		/* [in] */ IEmptyVolumeCacheCallBack * picb)
{
	PY_GATEWAY_METHOD;
	PyObject *obdwlSpaceToFree = PyLong_FromUnsignedLongLong(dwlSpaceToFree);
	if (obdwlSpaceToFree==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("Purge");
	PyObject *obpicb;
	obpicb = PyCom_PyObjectFromIUnknown(picb, IID_IEmptyVolumeCacheCallBack, TRUE);
	if (!obpicb) {
		Py_DECREF(obdwlSpaceToFree);
		return MAKE_PYCOM_GATEWAY_FAILURE_CODE("Purge");
	}
	return InvokeViaPolicy("Purge", NULL, "NN", obdwlSpaceToFree, obpicb);
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:16,代码来源:PyIEmptyVolumeCache.cpp


示例4: PyWinObject_FromIID

STDMETHODIMP PyGConnectionPointContainer::FindConnectionPoint(REFIID riid, IConnectionPoint **ppCP)
{
	PY_GATEWAY_METHOD;
	if (ppCP==NULL) return E_POINTER;
	*ppCP = NULL;
	PyObject *obIID = PyWinObject_FromIID(riid);
	PyObject *result;
	HRESULT hr = InvokeViaPolicy("FindConnectionPoint", &result, "O", obIID);
	Py_XDECREF(obIID);
	if (FAILED(hr)) return hr;
	if (result != Py_None && !PyCom_InterfaceFromPyObject(result, IID_IConnectionPoint, (void **)ppCP))
		hr = PyCom_SetCOMErrorFromPyException(GetIID());
	Py_XDECREF(result);
	return (hr==S_OK && *ppCP==NULL) ? CONNECT_E_NOCONNECTION : hr;
}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:15,代码来源:PyGConnectionPointContainer.cpp


示例5: InvokeViaPolicy

STDMETHODIMP PyGActiveScriptError::GetExceptionInfo(EXCEPINFO FAR *pexcepinfo)
{
	if (pexcepinfo==NULL) return E_POINTER;
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr = InvokeViaPolicy("GetExceptionInfo", &result, NULL);
	if (FAILED(hr))
		return hr;

	if (!PyCom_ExcepInfoFromPyObject(result, pexcepinfo))
		hr = E_FAIL;

	Py_DECREF(result);
	return hr;
}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:15,代码来源:PyGActiveScriptError.cpp


示例6: PyWinObject_FromPARAM

STDMETHODIMP PyGShellBrowser::SendControlMsg(
		/* [in] */ UINT id,
		/* [in] */ UINT uMsg,
		/* [in] */ WPARAM wParam,
		/* [in] */ LPARAM lParam,
		/* [in] */ LRESULT * pret)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("SendControlMsg", &result, "iiNN", id, uMsg, PyWinObject_FromPARAM(wParam), PyWinObject_FromPARAM(lParam));
	if (PyInt_Check(result) || PyLong_Check(result))
		PyWinLong_AsULONG_PTR(result, (ULONG_PTR *)pret);
	Py_DECREF(result);
	return hr;
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:15,代码来源:PyIShellBrowser.cpp


示例7:

STDMETHODIMP PyGPersistFolder2::GetCurFolder(
		/* [out] */ PIDLIST_ABSOLUTE * ppidl)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetCurFolder", &result);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	if (!PyObject_AsPIDL(result, ppidl, TRUE))
		hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetCurFolder");
	else
		hr = *ppidl ? S_OK : S_FALSE; // this is what the docs say!
	Py_DECREF(result);
	return hr;
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:15,代码来源:PyIPersistFolder2.cpp


示例8: PyWinObject_FromPROPIDs

STDMETHODIMP PyGPropertyStorage::WritePropertyNames(
		/* [in] */ ULONG cpropid,
		/* [size_is][in] */ const PROPID rgpropid[],
		/* [size_is][in] */ const LPOLESTR rglpwstrName[])
{
	PY_GATEWAY_METHOD;
	{	// Scope so Tmp objects are DECREF'ed before lock released
	TmpPyObject obpropids = PyWinObject_FromPROPIDs(rgpropid, cpropid);
	if (obpropids==NULL)
		return MAKE_PYCOM_GATEWAY_FAILURE_CODE("WritePropertyNames");
	TmpPyObject obnames = PyWinObject_FromWCHARArray(rglpwstrName, cpropid);
	if (obnames==NULL)
		return MAKE_PYCOM_GATEWAY_FAILURE_CODE("WritePropertyNames");
	return InvokeViaPolicy("WritePropertyNames", NULL, "OO", obpropids, obnames);
	}
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:16,代码来源:PyIPropertyStorage.cpp


示例9: GetHostInfo

STDMETHODIMP PyGDocHostUIHandler::GetHostInfo(
		/* [out][in] */ DOCHOSTUIINFO * pInfo)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetHostInfo", &result, "");
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	PyObject *obhostcss, *obhostns;
	if (!PyArg_ParseTuple(result, "iiOO", &pInfo->dwFlags, &pInfo->dwDoubleClick, &obhostcss, &obhostns) ||
	    !PyWinObject_AsTaskAllocatedWCHAR(obhostcss, &pInfo->pchHostCss, TRUE, NULL) ||
	    !PyWinObject_AsTaskAllocatedWCHAR(obhostns, &pInfo->pchHostNS, TRUE, NULL))
		hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetHostInfo");
	Py_DECREF(result);
	return hr;
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:16,代码来源:PyIDocHostUIHandler.cpp


示例10: GetCurFile

STDMETHODIMP PyGPersistFile::GetCurFile(
		/* [out] */ LPOLESTR __RPC_FAR * ppszFileName)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetCurFile", &result);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	PyObject *obppszFileName;
	if (!PyArg_Parse(result, "O" , &obppszFileName))
		hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	else if (!PyWinObject_AsTaskAllocatedWCHAR(obppszFileName, ppszFileName))
		hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:16,代码来源:PyIPersistFile.cpp


示例11: PyObject_FromSHCOLUMNID

STDMETHODIMP PyGCategoryProvider::GetCategoryForSCID(
		/* [in] */ __RPC__in const SHCOLUMNID * pscid,
		/* [out] */ __RPC__out GUID * pguid)
{
	PY_GATEWAY_METHOD;
	PyObject *obpscid = PyObject_FromSHCOLUMNID(pscid);
	if (obpscid==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetCategoryForSCID");
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetCategoryForSCID", &result, "(O)", obpscid);
	Py_DECREF(obpscid);
	if (FAILED(hr)) return hr;
	if (!PyWinObject_AsIID(result, pguid))
		hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetCategoryForSCID");
	Py_DECREF(result);
	return hr;
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:16,代码来源:PyICategoryProvider.cpp


示例12: PyCom_PyObjectFromIUnknown

STDMETHODIMP PyGTransferSource::RemoveItem(
		/* [in] */ IShellItem * psiSource,
		/* [in] */ TRANSFER_SOURCE_FLAGS flags)
{
	PY_GATEWAY_METHOD;
	PyObject *obpsiSource, *result;
	obpsiSource = PyCom_PyObjectFromIUnknown(psiSource, IID_IShellItem, TRUE);
	HRESULT hr=InvokeViaPolicy("RemoveItem", &result, "Oi", obpsiSource, flags);
	Py_XDECREF(obpsiSource);
	if (FAILED(hr))
		return hr;
	hr = PyLong_AsLong(result);
	if (hr == -1 && PyErr_Occurred())
		hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("RemoveItem");
	return hr;
}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:16,代码来源:PyITransferSource.cpp


示例13: InvokeViaPolicy

STDMETHODIMP PyGActiveScriptSite::GetLCID( 
            /* [out] */ LCID FAR *plcid)
{
	PY_GATEWAY_METHOD;
	if ( plcid == NULL )
		return E_POINTER;

	PyObject *result;
	HRESULT hr = InvokeViaPolicy("GetLCID", &result, NULL);
	if (FAILED(hr))
		return hr;

	*plcid = PyInt_AsLong(result);
	Py_DECREF(result);
	return PyCom_HandlePythonFailureToCOM();
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:16,代码来源:PyGActiveScriptSite.cpp


示例14: GetDocumentClassId

STDMETHODIMP PyGDebugDocumentInfo::GetDocumentClassId(
		/* [out] */ GUID __RPC_FAR * pclsidDocument)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetDocumentClassId", &result);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	PyObject *obpclsidDocument;
	if (!PyArg_Parse(result, "O" , &obpclsidDocument)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	BOOL bPythonIsHappy = TRUE;
	if (!PyWinObject_AsIID(obpclsidDocument, pclsidDocument)) bPythonIsHappy = FALSE;
	if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:16,代码来源:PyIDebugDocumentInfo.cpp


示例15: PyObject_FromOLEMENUGROUPWIDTHS

STDMETHODIMP PyGShellBrowser::InsertMenusSB(
		/* [in] */ HMENU hmenuShared,
		/* [out][in] */ LPOLEMENUGROUPWIDTHS lpMenuWidths)
{
	static const char *method_name = "InsertMenusSB";
	PY_GATEWAY_METHOD;
	PyObject *oblpMenuWidths = PyObject_FromOLEMENUGROUPWIDTHS(lpMenuWidths);
	if (oblpMenuWidths==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name);
	PyObject *result;
	HRESULT hr=InvokeViaPolicy(method_name, &result, "NO", PyWinLong_FromHANDLE(hmenuShared), oblpMenuWidths);
	Py_DECREF(oblpMenuWidths);
	if (FAILED(hr)) return hr;
	PyObject_AsOLEMENUGROUPWIDTHS(result, lpMenuWidths);
	Py_DECREF(result);
	return PyCom_SetCOMErrorFromPyException(GetIID());
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:16,代码来源:PyIShellBrowser.cpp


示例16: PyCom_PyObjectFromIUnknown

STDMETHODIMP PyGShellItem::Compare(
		/* [in] */ IShellItem * psi,
		/* [in] */ SICHINTF hint,
		/* [out] */ int * piOrder)
{
	PY_GATEWAY_METHOD;
	PyObject *obpsi;
	obpsi = PyCom_PyObjectFromIUnknown(psi, IID_IShellItem, TRUE);
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("Compare", &result, "Ok", obpsi, hint);
	Py_XDECREF(obpsi);
	if (FAILED(hr)) return hr;
	*piOrder = PyInt_AsLong(result);
	hr = PyCom_SetAndLogCOMErrorFromPyException("Compare", IID_IShellItem);
	Py_DECREF(result);
	return hr;
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:17,代码来源:PyIShellItem.cpp


示例17: InvokeViaPolicy

// Std delegation
STDMETHODIMP PyGEnumResources::Next( 
            /* [in] */ ULONG celt,
            /* [out] */ SHELL_ITEM_RESOURCE *rgVar,
            /* [out] */ ULONG *pCeltFetched)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt);
	if ( FAILED(hr) )
		return hr;

	if ( !PySequence_Check(result) )
		goto error;
	int len;
	len = PyObject_Length(result);
	if ( len == -1 )
		goto error;
	if ( len > (int)celt)
		len = celt;

	if ( pCeltFetched )
		*pCeltFetched = len;

	int i;
	for ( i = 0; i < len; ++i )
	{
		PyObject *ob = PySequence_GetItem(result, i);
		if ( ob == NULL )
			goto error;

		if ( !PyWinObject_AsSHELL_ITEM_RESOURCE(ob, &rgVar[i]))
		{
			Py_DECREF(result);
			return PyCom_SetCOMErrorFromPyException(IID_IEnumResources);
		}
	}

	Py_DECREF(result);

	return len < (int)celt ? S_FALSE : S_OK;

  error:
	PyErr_Clear();	// just in case
	Py_DECREF(result);
	return PyCom_SetCOMErrorFromSimple(E_FAIL, IID_IEnumResources, "Next() did not return a sequence of objects");
}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:47,代码来源:PyIEnumResources.cpp


示例18: InvokeViaPolicy

STDMETHODIMP PyGEnumIDList::Next( 
            /* [in] */ ULONG celt,
            /* [length_is][size_is][out] */ LPITEMIDLIST *pi,
            /* [out] */ ULONG __RPC_FAR *pCeltFetched)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt);
	if ( FAILED(hr) )
		return hr;

	if ( !PySequence_Check(result) )
		goto error;
	int len;
	len = PyObject_Length(result);
	if ( len == -1 )
		goto error;
	if ( len > (int)celt)
		len = celt;

	if ( pCeltFetched )
		*pCeltFetched = len;

	int i;
	for ( i = 0; i < len; ++i )
	{
		PyObject *ob = PySequence_GetItem(result, i);
		if ( ob == NULL )
			goto error;

		if ( !PyObject_AsPIDL(ob, &pi[i] ))
		{
			Py_DECREF(result);
			return PyCom_SetCOMErrorFromPyException(IID_IEnumIDList);
		}
	}

	Py_DECREF(result);

	return len < (int)celt ? S_FALSE : S_OK;

  error:
	PyErr_Clear();	// just in case
	Py_DECREF(result);
	return PyCom_SetCOMErrorFromSimple(E_FAIL, IID_IEnumIDList, "Next() did not return a sequence of objects");
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:46,代码来源:PyIEnumIDList.cpp


示例19: PyObject_FromFORMATETC

STDMETHODIMP PyGDataObject::GetCanonicalFormatEtc(
		/* [unique][in] */ FORMATETC * pformatectIn,
		/* [out] */ FORMATETC * pformatetcOut)
{
	static const char *method_name = "GetCanonicalFormatEtc";
	PY_GATEWAY_METHOD;
	PyObject *obpformatectIn = PyObject_FromFORMATETC(pformatectIn);
	if (obpformatectIn==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name);
	PyObject *result;
	HRESULT hr=InvokeViaPolicy(method_name, &result, "(O)", obpformatectIn);
	Py_DECREF(obpformatectIn);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	PyObject_AsFORMATETC(result, pformatetcOut);
	Py_DECREF(result);
	return hr;
}
开发者ID:Logan-lu,项目名称:pywin32,代码行数:17,代码来源:PyIDataObject.cpp


示例20: Stat

STDMETHODIMP PyGLockBytes::Stat(
		/* [out] */ STATSTG __RPC_FAR * pstatstg,
		/* [in] */ DWORD grfStatFlag)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("Stat", &result, "i", grfStatFlag);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	PyObject *obpstatstg;
	if (!PyArg_Parse(result, "O" , &obpstatstg)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	BOOL bPythonIsHappy = TRUE;
	if (!PyCom_PyObjectAsSTATSTG(obpstatstg, pstatstg, 0/*flags*/)) bPythonIsHappy = FALSE;
	if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
开发者ID:DavidGuben,项目名称:rcbplayspokemon,代码行数:17,代码来源:PyILockBytes.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IoAcquireRemoveLock函数代码示例发布时间:2022-05-30
下一篇:
C++ Invoke函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap