本文整理汇总了C++中InvokeViaPolicy函数的典型用法代码示例。如果您正苦于以下问题:C++ InvokeViaPolicy函数的具体用法?C++ InvokeViaPolicy怎么用?C++ InvokeViaPolicy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InvokeViaPolicy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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());
}