Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17954/win32/src
Modified Files:
win32gui.i
Log Message:
Fix a regression in win32gui.CreateDC()
Index: win32gui.i
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v
retrieving revision 1.75
retrieving revision 1.76
diff -C2 -d -r1.75 -r1.76
*** win32gui.i 10 Jan 2006 05:37:50 -0000 1.75
--- win32gui.i 11 Jan 2006 00:10:18 -0000 1.76
***************
*** 3796,3800 ****
// @pyparm string|Device||Name of specific device, eg printer name returned from GetDefaultPrinter
// @pyparm <o PyDEVMODE>|InitData||A PyDEVMODE that specifies printing parameters, use None for printer defaults
! HDC CreateDC(TCHAR *INPUT_NULLOK, TCHAR *INPUT_NULLOK, TCHAR *INPUT, DEVMODE *INPUT);
%{
--- 3796,3832 ----
// @pyparm string|Device||Name of specific device, eg printer name returned from GetDefaultPrinter
// @pyparm <o PyDEVMODE>|InitData||A PyDEVMODE that specifies printing parameters, use None for printer defaults
!
! %native (CreateDC) PyCreateDC;
! %{
! static PyObject *PyCreateDC(PyObject *self, PyObject *args)
! {
! PDEVMODE pdevmode;
! PyObject *obdevmode=NULL;
! PyObject *obdriver, *obdevice;
! char *driver, *device, *dummyoutput=NULL;
! HDC hdc;
! if (!PyArg_ParseTuple(args, "OOO", &obdriver, &obdevice, &obdevmode))
! return NULL;
! if (!PyWinObject_AsDEVMODE(obdevmode, &pdevmode, TRUE))
! return NULL;
! if (!PyWinObject_AsTCHAR(obdriver, &driver, FALSE))
! return NULL;
! if (!PyWinObject_AsTCHAR(obdevice, &device, TRUE)) {
! PyWinObject_FreeTCHAR(driver);
! return NULL;
! }
! PyObject *ret;
! hdc=CreateDC(driver, device, dummyoutput, pdevmode);
! if (hdc!=NULL)
! ret = Py_BuildValue("l",hdc);
! else {
! PyWin_SetAPIError("CreateDC",GetLastError());
! ret = NULL;
! }
! PyWinObject_FreeTCHAR(driver);
! PyWinObject_FreeTCHAR(device);
! return ret;
! }
! %}
%{
|