[pywin32-checkins] pywin32/com/win32comext/shell/src PyIShellBrowser.cpp, 1.9, 1.10
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-08-18 13:04:01
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13809/win32comext/shell/src Modified Files: PyIShellBrowser.cpp Log Message: s/PyCom_HandlePythonFailureToCOM/MAKE_PYCOM_GATEWAY_FAILURE_CODE/ in some gateways for better error reporting. Index: PyIShellBrowser.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellBrowser.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyIShellBrowser.cpp 3 Jun 2007 14:53:07 -0000 1.9 --- PyIShellBrowser.cpp 18 Aug 2008 13:04:10 -0000 1.10 *************** *** 402,410 **** /* [out][in] */ LPOLEMENUGROUPWIDTHS lpMenuWidths) { PY_GATEWAY_METHOD; PyObject *oblpMenuWidths = PyObject_FromOLEMENUGROUPWIDTHS(lpMenuWidths); ! if (oblpMenuWidths==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *result; ! HRESULT hr=InvokeViaPolicy("InsertMenusSB", &result, "NO", PyWinLong_FromHANDLE(hmenuShared), oblpMenuWidths); Py_DECREF(oblpMenuWidths); if (FAILED(hr)) return hr; --- 402,411 ---- /* [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; *************** *** 456,463 **** /* [in] */ WORD wID) { PY_GATEWAY_METHOD; PyObject *obpmsg = PyObject_FromMSG(pmsg); ! if (obpmsg==NULL) return PyCom_HandlePythonFailureToCOM(); ! HRESULT hr=InvokeViaPolicy("TranslateAcceleratorSB", NULL, "OH", obpmsg, wID); Py_DECREF(obpmsg); return hr; --- 457,465 ---- /* [in] */ WORD wID) { + static const char *method_name = "TranslateAcceleratorSB"; PY_GATEWAY_METHOD; PyObject *obpmsg = PyObject_FromMSG(pmsg); ! if (obpmsg==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); ! HRESULT hr=InvokeViaPolicy(method_name, NULL, "OH", obpmsg, wID); Py_DECREF(obpmsg); return hr; *************** *** 480,494 **** /* [out] */ IStream ** ppStrm) { PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy("GetViewStateStream", &result, "l", grfMode); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppStrm; ! if (!PyArg_Parse(result, "O" , &obppStrm)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppStrm, IID_IStream, (void **)ppStrm, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; --- 482,497 ---- /* [out] */ IStream ** ppStrm) { + static const char *method_name = "GetViewStateStream"; PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result, "l", grfMode); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppStrm; ! if (!PyArg_Parse(result, "O" , &obppStrm)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppStrm, IID_IStream, (void **)ppStrm, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); Py_DECREF(result); return hr; *************** *** 499,509 **** /* [out] */ HWND * phwnd) { PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy("GetControlWindow", &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 = PyCom_HandlePythonFailureToCOM(); Py_DECREF(result); return hr; --- 502,513 ---- /* [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; *************** *** 529,543 **** /* [out] */ IShellView ** ppshv) { PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy("QueryActiveShellView", &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppshv; ! if (!PyArg_Parse(result, "O" , &obppshv)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppshv, IID_IShellView, (void **)ppshv, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/); Py_DECREF(result); return hr; --- 533,548 ---- /* [out] */ IShellView ** ppshv) { + static const char *method_name = "QueryActiveShellView"; PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy(method_name, &result); if (FAILED(hr)) return hr; // Process the Python results, and convert back to the real params PyObject *obppshv; ! if (!PyArg_Parse(result, "O" , &obppshv)) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); BOOL bPythonIsHappy = TRUE; if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppshv, IID_IShellView, (void **)ppshv, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); Py_DECREF(result); return hr; *************** *** 560,563 **** --- 565,569 ---- /* [in] */ UINT uFlags) { + static const char *method_name = "SetToolbarItems"; PY_GATEWAY_METHOD; // *** The input argument lpButtons of type "LPTBBUTTONSB" was not processed *** *************** *** 566,571 **** PyObject *oblpButtons = Py_None; //PyObject_FromLPTBBUTTONSB(lpButtons); Py_INCREF(Py_None); ! if (oblpButtons==NULL) return PyCom_HandlePythonFailureToCOM(); ! HRESULT hr=InvokeViaPolicy("SetToolbarItems", NULL, "Oii", oblpButtons, nButtons, uFlags); Py_DECREF(oblpButtons); return hr; --- 572,577 ---- PyObject *oblpButtons = Py_None; //PyObject_FromLPTBBUTTONSB(lpButtons); Py_INCREF(Py_None); ! if (oblpButtons==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE(method_name); ! HRESULT hr=InvokeViaPolicy(method_name, NULL, "Oii", oblpButtons, nButtons, uFlags); Py_DECREF(oblpButtons); return hr; |