[pywin32-checkins] pywin32/com/win32comext/shell/src PyIShellBrowser.cpp,1.2,1.3
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2004-04-09 11:28:29
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27056 Modified Files: PyIShellBrowser.cpp Log Message: Complete implemention of menu related functions. Index: PyIShellBrowser.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellBrowser.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIShellBrowser.cpp 9 Oct 2003 12:07:12 -0000 1.2 --- PyIShellBrowser.cpp 9 Apr 2004 11:15:10 -0000 1.3 *************** *** 9,12 **** --- 9,15 ---- // --------------------------------------------------- // + extern BOOL PyObject_AsOLEMENUGROUPWIDTHS( PyObject *oblpMenuWidths, OLEMENUGROUPWIDTHS *pWidths); + PyObject *PyObject_FromOLEMENUGROUPWIDTHS(OLEMENUGROUPWIDTHS *p); + // Interface Implementation *************** *** 25,29 **** return (IShellBrowser *)PyIOleWindow::GetI(self); } ! /* // @pymethod |PyIShellBrowser|InsertMenusSB|Description of InsertMenusSB. PyObject *PyIShellBrowser::InsertMenusSB(PyObject *self, PyObject *args) --- 28,32 ---- return (IShellBrowser *)PyIOleWindow::GetI(self); } ! // @pymethod |PyIShellBrowser|InsertMenusSB|Description of InsertMenusSB. PyObject *PyIShellBrowser::InsertMenusSB(PyObject *self, PyObject *args) *************** *** 33,65 **** return NULL; // @pyparm int|hmenuShared||Description for hmenuShared ! // *** The input argument lpMenuWidths of type "LPOLEMENUGROUPWIDTHS" was not processed *** ! // Please check the conversion function is appropriate and exists! ! LPOLEMENUGROUPWIDTHS lpMenuWidths; ! PyObject *oblpMenuWidths; // @pyparm <o PyLPOLEMENUGROUPWIDTHS>|lpMenuWidths||Description for lpMenuWidths INT ihmenuShared; HMENU hmenuShared; ! if ( !PyArg_ParseTuple(args, "iO:InsertMenusSB", &ihmenuShared, &oblpMenuWidths) ) return NULL; BOOL bPythonIsHappy = TRUE; ! hmenuShared = ihmenuShared; ! if (bPythonIsHappy && !PyObject_AsLPOLEMENUGROUPWIDTHS( oblpMenuWidths, &lpMenuWidths )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; ! hr = pISB->InsertMenusSB( hmenuShared, lpMenuWidths ); ! PyObject_FreeLPOLEMENUGROUPWIDTHS(lpMenuWidths); ! PY_INTERFACE_POSTCALL; - if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); ! // *** The output argument lpMenuWidths of type "LPOLEMENUGROUPWIDTHS" was not processed *** ! // The type 'LPOLEMENUGROUPWIDTHS' (lpMenuWidths) is unknown. ! Py_INCREF(Py_None); ! return Py_None; ! } ! */ // @pymethod |PyIShellBrowser|SetMenuSB|Description of SetMenuSB. PyObject *PyIShellBrowser::SetMenuSB(PyObject *self, PyObject *args) --- 36,59 ---- return NULL; // @pyparm int|hmenuShared||Description for hmenuShared ! OLEMENUGROUPWIDTHS menuWidths; ! PyObject *obMenuWidths; // @pyparm <o PyLPOLEMENUGROUPWIDTHS>|lpMenuWidths||Description for lpMenuWidths INT ihmenuShared; HMENU hmenuShared; ! if ( !PyArg_ParseTuple(args, "iO:InsertMenusSB", &ihmenuShared, &obMenuWidths) ) return NULL; BOOL bPythonIsHappy = TRUE; ! hmenuShared = (HMENU)ihmenuShared; ! if (bPythonIsHappy && !PyObject_AsOLEMENUGROUPWIDTHS( obMenuWidths, &menuWidths )) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; ! hr = pISB->InsertMenusSB( hmenuShared, &menuWidths ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pISB, IID_IShellBrowser ); ! return PyObject_FromOLEMENUGROUPWIDTHS(&menuWidths); } ! // @pymethod |PyIShellBrowser|SetMenuSB|Description of SetMenuSB. PyObject *PyIShellBrowser::SetMenuSB(PyObject *self, PyObject *args) *************** *** 379,383 **** static struct PyMethodDef PyIShellBrowser_methods[] = { ! // { "InsertMenusSB", PyIShellBrowser::InsertMenusSB, 1 }, // @pymeth InsertMenusSB|Description of InsertMenusSB { "SetMenuSB", PyIShellBrowser::SetMenuSB, 1 }, // @pymeth SetMenuSB|Description of SetMenuSB { "RemoveMenusSB", PyIShellBrowser::RemoveMenusSB, 1 }, // @pymeth RemoveMenusSB|Description of RemoveMenusSB --- 373,377 ---- static struct PyMethodDef PyIShellBrowser_methods[] = { ! { "InsertMenusSB", PyIShellBrowser::InsertMenusSB, 1 }, // @pymeth InsertMenusSB|Description of InsertMenusSB { "SetMenuSB", PyIShellBrowser::SetMenuSB, 1 }, // @pymeth SetMenuSB|Description of SetMenuSB { "RemoveMenusSB", PyIShellBrowser::RemoveMenusSB, 1 }, // @pymeth RemoveMenusSB|Description of RemoveMenusSB *************** *** 409,417 **** { PY_GATEWAY_METHOD; ! // *** The input argument lpMenuWidths of type "LPOLEMENUGROUPWIDTHS" was not processed *** ! // - Please ensure this conversion function exists, and is appropriate ! // - The type 'LPOLEMENUGROUPWIDTHS' (lpMenuWidths) is unknown. ! PyObject *oblpMenuWidths = Py_None; //PyObject_FromLPOLEMENUGROUPWIDTHS(lpMenuWidths); ! Py_INCREF(Py_None); if (oblpMenuWidths==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *result; --- 403,407 ---- { PY_GATEWAY_METHOD; ! PyObject *oblpMenuWidths = PyObject_FromOLEMENUGROUPWIDTHS(lpMenuWidths); if (oblpMenuWidths==NULL) return PyCom_HandlePythonFailureToCOM(); PyObject *result; *************** *** 419,424 **** Py_DECREF(oblpMenuWidths); if (FAILED(hr)) return hr; Py_DECREF(result); ! return hr; } --- 409,415 ---- Py_DECREF(oblpMenuWidths); if (FAILED(hr)) return hr; + PyObject_AsOLEMENUGROUPWIDTHS(result, lpMenuWidths); Py_DECREF(result); ! return PyCom_SetCOMErrorFromPyException(GetIID()); } |