Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4251/com/win32com/src/extensions
Modified Files:
PyIOleWindow.cpp
Log Message:
Fix a couple of places where HWND treated as an int
Index: PyIOleWindow.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIOleWindow.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PyIOleWindow.cpp 9 Oct 2003 00:26:23 -0000 1.1
--- PyIOleWindow.cpp 25 Jun 2007 05:15:36 -0000 1.2
***************
*** 33,49 ****
if ( pIOW == NULL )
return NULL;
! HWND phwnd;
if ( !PyArg_ParseTuple(args, ":GetWindow") )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
! hr = pIOW->GetWindow( &phwnd );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIOW, IID_IOleWindow);
!
! PyObject *pyretval = Py_BuildValue("i", phwnd);
! return pyretval;
}
--- 33,47 ----
if ( pIOW == NULL )
return NULL;
! HWND hwnd;
if ( !PyArg_ParseTuple(args, ":GetWindow") )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
! hr = pIOW->GetWindow( &hwnd );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIOW, IID_IOleWindow);
! return PyWinLong_FromHANDLE(hwnd);
}
***************
*** 94,98 ****
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
! if (!PyArg_Parse(result, "i" , phwnd)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
Py_DECREF(result);
return hr;
--- 92,97 ----
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(/*pexcepinfo*/);
Py_DECREF(result);
return hr;
|