Update of /cvsroot/pywin32/pywin32/Pythonwin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11967/Pythonwin
Modified Files:
pythonpsheet.cpp pythonpsheet.h win32ctrlRichEdit.cpp
win32ui.h win32uiExt.h win32uiole.cpp win32util.cpp
win32virt.cpp win32win.cpp
Log Message:
Get pythonwin working in x64 - via "[ 1705634 ] VC8.0 build patch for
AMD64 branch" - thanks to Steve Yin for his excellent contribution
Index: win32ui.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ui.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** win32ui.h 7 Oct 2004 08:45:24 -0000 1.3
--- win32ui.h 24 May 2007 12:50:50 -0000 1.4
***************
*** 268,274 ****
BOOL call();
BOOL call(int);
! BOOL call(int, int);
BOOL call(int, int, int);
BOOL call(long);
BOOL call(const char *);
BOOL call(const char *, int);
--- 268,277 ----
BOOL call();
BOOL call(int);
! BOOL call(DWORD, DWORD);
! BOOL call(BOOL, BOOL);
! BOOL call(int v1, DWORD v2) {return call((DWORD)v1, v2);}
BOOL call(int, int, int);
BOOL call(long);
+ BOOL call(UINT_PTR);
BOOL call(const char *);
BOOL call(const char *, int);
***************
*** 289,292 ****
--- 292,296 ----
BOOL call(CDC *pDC, CWnd *pWnd, int i);
BOOL call(const MSG *);
+ BOOL call(WPARAM, LPARAM);
BOOL call(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO*pHandlerInfo);
BOOL call_args(PyObject *arglst);
Index: pythonpsheet.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pythonpsheet.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pythonpsheet.h 2 Mar 2000 01:11:15 -0000 1.2
--- pythonpsheet.h 24 May 2007 12:50:50 -0000 1.3
***************
*** 36,40 ****
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
! afx_msg LONG OnResizePage (UINT, LONG);
DECLARE_MESSAGE_MAP()
#ifdef _DEBUG
--- 36,40 ----
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
! afx_msg LRESULT OnResizePage (WPARAM, LPARAM);
DECLARE_MESSAGE_MAP()
#ifdef _DEBUG
Index: win32win.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32win.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** win32win.cpp 7 Apr 2007 05:23:31 -0000 1.12
--- win32win.cpp 24 May 2007 12:50:50 -0000 1.13
***************
*** 615,619 ****
pSearch = CWnd::FromHandlePermanent(wnd);
// FromHandlePerm is thread specific!
! if (pSearch==NULL && GetWindowLong(wnd, GWL_WNDPROC)==(LONG)AfxGetAfxWndProc()) {
/*******
--- 615,619 ----
pSearch = CWnd::FromHandlePermanent(wnd);
// FromHandlePerm is thread specific!
! if (pSearch==NULL && GetWindowLong(wnd, GWLP_WNDPROC)==(LONG)AfxGetAfxWndProc()) {
/*******
***************
*** 2798,2803 ****
// Convert the list of point tuples into an array of POINT structs
int num = PyList_Size (point_list);
POINT * point_array = new POINT[num];
! for (int i=0; i < num; i++)
{
PyObject * point_tuple = PyList_GetItem (point_list, i);
--- 2798,2804 ----
// Convert the list of point tuples into an array of POINT structs
int num = PyList_Size (point_list);
+ int i;
POINT * point_array = new POINT[num];
! for (i=0; i < num; i++)
{
PyObject * point_tuple = PyList_GetItem (point_list, i);
Index: pythonpsheet.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pythonpsheet.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pythonpsheet.cpp 20 Mar 2006 00:26:27 -0000 1.3
--- pythonpsheet.cpp 24 May 2007 12:50:50 -0000 1.4
***************
*** 246,250 ****
}
! LONG CPythonPropertySheet::OnResizePage (UINT, LONG)
{
// resize the page
--- 246,250 ----
}
! LRESULT CPythonPropertySheet::OnResizePage (WPARAM, LPARAM)
{
// resize the page
Index: win32uiExt.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32uiExt.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** win32uiExt.h 20 Mar 2006 00:26:27 -0000 1.9
--- win32uiExt.h 24 May 2007 12:50:50 -0000 1.10
***************
*** 229,237 ****
T::OnPaint();
}
! afx_msg void OnTimer(UINT nIDEvent) {
// @pyvirtual void|PyCWnd|OnTimer|Called for the WM_TIMER message.
// @pyparm int|nIDEvent||Specifies the identifier of the timer.
CVirtualHelper helper( "OnTimer", this );
! if (!helper.HaveHandler() || !helper.call(static_cast<int>(nIDEvent)))
T::OnTimer(nIDEvent);
}
--- 229,237 ----
T::OnPaint();
}
! afx_msg void OnTimer(UINT_PTR nIDEvent) {
// @pyvirtual void|PyCWnd|OnTimer|Called for the WM_TIMER message.
// @pyparm int|nIDEvent||Specifies the identifier of the timer.
CVirtualHelper helper( "OnTimer", this );
! if (!helper.HaveHandler() || !helper.call(nIDEvent))
T::OnTimer(nIDEvent);
}
***************
*** 291,295 ****
T::OnNcCalcSize(bCalcValidRects, lpncsp);
}
! afx_msg UINT OnNcHitTest(CPoint pt) {
// @pyvirtual int|PyCWnd|OnNcHitTest|Called for the WM_NCHITTEST message.
// @xref <om PyCWnd.OnNcHitTest>
--- 291,301 ----
T::OnNcCalcSize(bCalcValidRects, lpncsp);
}
! afx_msg
! #ifdef _M_X64 // add one more thing to things I don't understand..
! LRESULT
! #else
! UINT
! #endif
! OnNcHitTest(CPoint pt) {
// @pyvirtual int|PyCWnd|OnNcHitTest|Called for the WM_NCHITTEST message.
// @xref <om PyCWnd.OnNcHitTest>
***************
*** 389,392 ****
--- 395,399 ----
};
+ #define ThisClass CPythonWndFramework<T>
template <class T>
const AFX_MSGMAP_ENTRY CPythonWndFramework<T>::_messageEntries[] = {
***************
*** 410,414 ****
{0, 0, 0, 0, AfxSig_end, (AFX_PMSG)0 }
};
!
template <class T>
--- 417,421 ----
{0, 0, 0, 0, AfxSig_end, (AFX_PMSG)0 }
};
! #undef ThisClass
template <class T>
***************
*** 982,989 ****
template <class T>
const AFX_MSGMAP_ENTRY CPythonPrtDlgFramework<T>::_messageEntries[] = {
! ON_MESSAGE(WM_INITDIALOG, HandleInitDialog)
! ON_COMMAND(IDC_PRINT_TO_FILE, HandlePrintToFile)
! ON_COMMAND(IDC_PRINT_COLLATE, HandleCollate)
! ON_COMMAND_RANGE(IDC_PRINT_RANGE_ALL, IDC_PRINT_RANGE_PAGES, HandlePrintRange)
{0, 0, 0, 0, AfxSig_end, (AFX_PMSG)0 }
};
--- 989,996 ----
template <class T>
const AFX_MSGMAP_ENTRY CPythonPrtDlgFramework<T>::_messageEntries[] = {
! ON_MESSAGE(WM_INITDIALOG, &CPythonPrtDlgFramework<T>::HandleInitDialog)
! ON_COMMAND(IDC_PRINT_TO_FILE, &CPythonPrtDlgFramework<T>::HandlePrintToFile)
! ON_COMMAND(IDC_PRINT_COLLATE, &CPythonPrtDlgFramework<T>::HandleCollate)
! ON_COMMAND_RANGE(IDC_PRINT_RANGE_ALL, IDC_PRINT_RANGE_PAGES, &CPythonPrtDlgFramework<T>::HandlePrintRange)
{0, 0, 0, 0, AfxSig_end, (AFX_PMSG)0 }
};
Index: win32ctrlRichEdit.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ctrlRichEdit.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** win32ctrlRichEdit.cpp 16 Oct 2000 05:46:52 -0000 1.2
--- win32ctrlRichEdit.cpp 24 May 2007 12:50:50 -0000 1.3
***************
*** 80,84 ****
}
! DWORD CALLBACK PyCRichEditCallbackIn(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
// documentation for ths function seems to be wrong WRT return values.
--- 80,84 ----
}
! DWORD CALLBACK PyCRichEditCallbackIn(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
// documentation for ths function seems to be wrong WRT return values.
***************
*** 109,118 ****
}
! DWORD CALLBACK PyCRichEditCallbackOut(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
CEnterLeavePython _celp;
int retval = 0; // default abort stream
PyObject *method = (PyObject *)dwCookie;
! PyObject *args = Py_BuildValue("(s#)", pbBuff, cb);
PyObject *result = gui_call_object( method, args );
Py_DECREF(args);
--- 109,118 ----
}
! DWORD CALLBACK PyCRichEditCallbackOut(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
{
CEnterLeavePython _celp;
int retval = 0; // default abort stream
PyObject *method = (PyObject *)dwCookie;
! PyObject *args = Py_BuildValue("(s#)", pbBuff, (Py_ssize_t)cb);
PyObject *result = gui_call_object( method, args );
Py_DECREF(args);
Index: win32util.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32util.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** win32util.cpp 3 Nov 2004 20:36:28 -0000 1.7
--- win32util.cpp 24 May 2007 12:50:50 -0000 1.8
***************
*** 63,68 ****
virtual PyObject *getattr(char *name);
virtual int setattr(char *name, PyObject *v);
! static PyObject *getitem(PyObject *self, int index);
! static int getlength(PyObject *self);
CString repr();
protected:
--- 63,68 ----
virtual PyObject *getattr(char *name);
virtual int setattr(char *name, PyObject *v);
! static PyObject *getitem(PyObject *self, Py_ssize_t index);
! static Py_ssize_t getlength(PyObject *self);
CString repr();
protected:
***************
*** 111,115 ****
}
! /* static */ int PyCRect::getlength(PyObject *self)
{
// NEVER CHANGE THIS - you will break all the old
--- 111,115 ----
}
! /* static */ Py_ssize_t PyCRect::getlength(PyObject *self)
{
// NEVER CHANGE THIS - you will break all the old
***************
*** 118,122 ****
}
! /* static */ PyObject *PyCRect::getitem(PyObject *self, int index)
{
PyCRect *p = (PyCRect *)self;
--- 118,122 ----
}
! /* static */ PyObject *PyCRect::getitem(PyObject *self, Py_ssize_t index)
{
PyCRect *p = (PyCRect *)self;
***************
*** 883,887 ****
&pFmt->dwMask, // @tupleitem 0|int|mask|The mask to use. Bits in this mask indicate which of the following parameters are interpreted. Must be a combination the win32con.PFM_* constants.
&pFmt->wNumbering, // @tupleitem 1|int|numbering|The numbering style to use.
! &pFmt->wReserved, // @tupleitem 2|int|yHeight|Reserved
&pFmt->dxStartIndent, // @tupleitem 3|int|dxStartIndent|Indentation of the first line.
&pFmt->dxRightIndent,// @tupleitem 4|int|dxRightIndent|Indentation from the right.
--- 883,887 ----
&pFmt->dwMask, // @tupleitem 0|int|mask|The mask to use. Bits in this mask indicate which of the following parameters are interpreted. Must be a combination the win32con.PFM_* constants.
&pFmt->wNumbering, // @tupleitem 1|int|numbering|The numbering style to use.
! &pFmt->wEffects, // @tupleitem 2|int|yHeight|Reserved
&pFmt->dxStartIndent, // @tupleitem 3|int|dxStartIndent|Indentation of the first line.
&pFmt->dxRightIndent,// @tupleitem 4|int|dxRightIndent|Indentation from the right.
***************
*** 918,922 ****
pFmt->dwMask,
pFmt->wNumbering,
! pFmt->wReserved,
pFmt->dxStartIndent,
pFmt->dxRightIndent,
--- 918,922 ----
pFmt->dwMask,
pFmt->wNumbering,
! pFmt->wEffects,
pFmt->dxStartIndent,
pFmt->dxRightIndent,
Index: win32virt.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32virt.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** win32virt.cpp 20 Nov 2006 12:36:41 -0000 1.4
--- win32virt.cpp 24 May 2007 12:50:50 -0000 1.5
***************
*** 132,136 ****
return do_call(arglst);
}
! BOOL CVirtualHelper::call(int val, int val2)
{
if (!handler) return FALSE;
--- 132,136 ----
return do_call(arglst);
}
! BOOL CVirtualHelper::call(DWORD val, DWORD val2)
{
if (!handler) return FALSE;
***************
*** 139,142 ****
--- 139,150 ----
return do_call(arglst);
}
+ BOOL CVirtualHelper::call(BOOL v1, BOOL v2)
+ {
+ if (!handler) return FALSE;
+ CEnterLeavePython _celp;
+ PyObject *arglst = Py_BuildValue("(NN)",PyBool_FromLong(v1), PyBool_FromLong(v2));
+ return do_call(arglst);
+ }
+
BOOL CVirtualHelper::call(int val1, int val2, int val3)
{
***************
*** 154,157 ****
--- 162,173 ----
}
+ BOOL CVirtualHelper::call(UINT_PTR val)
+ {
+ if (!handler) return FALSE;
+ CEnterLeavePython _celp;
+ PyObject *arglst = Py_BuildValue("(N)",PyWinObject_FromULONG_PTR(val));
+ return do_call(arglst);
+ }
+
BOOL CVirtualHelper::call(const char *val)
{
***************
*** 416,419 ****
--- 432,443 ----
}
+ BOOL CVirtualHelper::call(WPARAM w, LPARAM l)
+ {
+ if (!handler) return FALSE;
+ CEnterLeavePython _celp;
+ PyObject *arglst = Py_BuildValue("NN",PyWinObject_FromPARAM(w), PyWinObject_FromPARAM(l));
+ return do_call(arglst);
+ }
+
BOOL CVirtualHelper::retnone()
{
Index: win32uiole.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32uiole.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** win32uiole.cpp 10 Aug 2006 10:11:06 -0000 1.6
--- win32uiole.cpp 24 May 2007 12:50:50 -0000 1.7
***************
*** 11,15 ****
--- 11,17 ----
// version does *not* give the error. Whatever.
#include "transact.h"
+ #ifndef _M_X64
#include "afxdao.h"
+ #endif
#if _MFC_VER >= 0x0700
***************
*** 88,91 ****
--- 90,96 ----
CHECK_NO_ARGS2(args, "DaoGetEngine");
+ # ifdef _M_X64
+ return NULL;
+ # else
AfxDaoInit();
DAODBEngine* pEngine = AfxDaoGetEngine();
***************
*** 96,99 ****
--- 101,105 ----
pEngine->Release();
return PyCom_PyObjectFromIUnknown(pDisp, IID_IDispatch, FALSE);
+ #endif
}
|