From 612514307b40a7582eca76bc11577a834c50a20e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 24 Sep 2012 23:43:41 +0000 Subject: [PATCH] 2012-09-25 01:40 UTC+0200 Viktor Szakats (harbour syenar.net) * extras/gtwvw/gtwvw.c * extras/gtwvw/gtwvw.hbp * extras/gtwvw/hbgtwvw.h * extras/gtwvw/wvwedit.c * extras/gtwvw/wvwfuncs.c * extras/gtwvw/wvwpush.c * extras/gtwvw/wvwstbar.c * extras/gtwvw/wvwtbar.c * updated to build without fatal errors on win x64. (code it still mostly 32-bit only though) --- harbour/ChangeLog | 12 ++++++++++++ harbour/extras/gtwvw/gtwvw.c | 10 ++-------- harbour/extras/gtwvw/gtwvw.hbp | 2 +- harbour/extras/gtwvw/hbgtwvw.h | 25 ++++++++++++++++++------- harbour/extras/gtwvw/wvwedit.c | 4 ++-- harbour/extras/gtwvw/wvwfuncs.c | 2 +- harbour/extras/gtwvw/wvwpush.c | 4 ++-- harbour/extras/gtwvw/wvwstbar.c | 4 ++-- harbour/extras/gtwvw/wvwtbar.c | 4 ++-- 9 files changed, 42 insertions(+), 25 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ba9a70543c..8ec84f2a54 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,18 @@ The license applies to all entries newer than 2009-04-28. */ +2012-09-25 01:40 UTC+0200 Viktor Szakats (harbour syenar.net) + * extras/gtwvw/gtwvw.c + * extras/gtwvw/gtwvw.hbp + * extras/gtwvw/hbgtwvw.h + * extras/gtwvw/wvwedit.c + * extras/gtwvw/wvwfuncs.c + * extras/gtwvw/wvwpush.c + * extras/gtwvw/wvwstbar.c + * extras/gtwvw/wvwtbar.c + * updated to build without fatal errors on win x64. + (code it still mostly 32-bit only though) + 2012-09-25 00:20 UTC+0200 Viktor Szakats (harbour syenar.net) * utils/hbmk2/hbmk2.prg + hbstart.hb is now searched also at standard location on *nix diff --git a/harbour/extras/gtwvw/gtwvw.c b/harbour/extras/gtwvw/gtwvw.c index d476943f9d..ae3a37fa04 100644 --- a/harbour/extras/gtwvw/gtwvw.c +++ b/harbour/extras/gtwvw/gtwvw.c @@ -93,12 +93,6 @@ #include "hbgtwvw.h" -#if (defined(__MSC6__) || defined(__DMC__)) - #define LONG_PTR LONG - #define SetWindowLongPtr SetWindowLong - #define GetWindowLongPtr GetWindowLong -#endif - #if defined(__WATCOMC__) #include #endif @@ -10949,8 +10943,8 @@ UINT ButtonCreate( UINT usWinNum, USHORT usTop, USHORT usLeft, USHORT usBottom, AddControlHandle(usWinNum, WVW_CONTROL_PUSHBUTTON, hWndButton, uiPBid, (PHB_ITEM) phbiCodeBlock, rXB, rOffXB, (byte) iStyle); - //OldProc = SetWindowLong (hWndButton, - //GWLP_WNDPROC, (LONG)hb_gt_wvwBtnProc) ; + //OldProc = SetWindowLongPtr (hWndButton, + //GWLP_WNDPROC, (LONG_PTR)hb_gt_wvwBtnProc) ; OldProc = SubclassWindow( hWndButton, hb_gt_wvwBtnProc) ; StoreControlProc(usWinNum, WVW_CONTROL_PUSHBUTTON, hWndButton, OldProc); diff --git a/harbour/extras/gtwvw/gtwvw.hbp b/harbour/extras/gtwvw/gtwvw.hbp index 488b59c3c3..7fd23cad2f 100644 --- a/harbour/extras/gtwvw/gtwvw.hbp +++ b/harbour/extras/gtwvw/gtwvw.hbp @@ -11,7 +11,7 @@ # TODO: Disabled UNICODE until this code gets support for it. -winuni- -"-stop={!allwin|!x86}Skipped: '${hb_name}' only supported on win x86 platform." +"-stop={!allwin}Skipped: '${hb_name}' only supported on win platform." gtwvw.c wvwcheck.c diff --git a/harbour/extras/gtwvw/hbgtwvw.h b/harbour/extras/gtwvw/hbgtwvw.h index 2d94584c4b..ffd78c7e35 100644 --- a/harbour/extras/gtwvw/hbgtwvw.h +++ b/harbour/extras/gtwvw/hbgtwvw.h @@ -128,13 +128,7 @@ #if ! defined( _MSC_VER ) #if !defined( LONG_PTR ) - typedef __int64 LONG_PTR ; - #ifndef SetWindowLongPtr - #define SetWindowLongPtr SetWindowLong - #endif - #ifndef GetWindowLongPtr - #define GetWindowLongPtr GetWindowLong - #endif + typedef __int64 LONG_PTR; #endif #endif #endif @@ -142,6 +136,23 @@ #include #endif +#if ( ( defined( _MSC_VER ) && ( _MSC_VER <= 1200 || defined( HB_OS_WIN_CE ) ) ) || \ + defined( __DMC__ ) ) && !defined( HB_ARCH_64BIT ) +# ifndef GetWindowLongPtr +# define GetWindowLongPtr GetWindowLong +# endif +# ifndef SetWindowLongPtr +# define SetWindowLongPtr SetWindowLong +# endif +# ifndef SetClassLongPtr +# define SetClassLongPtr SetClassLong +# endif +#endif + +#if (defined(__MSC6__) || defined(__DMC__)) + #define LONG_PTR LONG +#endif + #include #include diff --git a/harbour/extras/gtwvw/wvwedit.c b/harbour/extras/gtwvw/wvwedit.c index 6d4321c632..e0d2498b07 100644 --- a/harbour/extras/gtwvw/wvwedit.c +++ b/harbour/extras/gtwvw/wvwedit.c @@ -265,8 +265,8 @@ HB_FUNC( WVW_EBCREATE) AddControlHandle(usWinNum, WVW_CONTROL_EDITBOX, hWndEB, uiEBid, (PHB_ITEM) hb_param( 7, HB_IT_BLOCK ), rXB, rOffXB, (byte) bEBType); - OldProc = (WNDPROC) SetWindowLong (hWndEB, - GWL_WNDPROC, (LONG) hb_gt_wvwEBProc) ; + OldProc = (WNDPROC) SetWindowLongPtr (hWndEB, + GWLP_WNDPROC, (LONG_PTR) hb_gt_wvwEBProc) ; StoreControlProc(usWinNum, WVW_CONTROL_EDITBOX, hWndEB, OldProc); diff --git a/harbour/extras/gtwvw/wvwfuncs.c b/harbour/extras/gtwvw/wvwfuncs.c index fec36f84c8..b0b429e491 100644 --- a/harbour/extras/gtwvw/wvwfuncs.c +++ b/harbour/extras/gtwvw/wvwfuncs.c @@ -1602,7 +1602,7 @@ HB_FUNC( WVW_SETPOINTER ) break; } - SetClassLong( pWindowData->hWnd, GCL_HCURSOR, ( DWORD ) hCursor ); + SetClassLongPtr( pWindowData->hWnd, GCLP_HCURSOR, ( LONG_PTR ) hCursor ); } /*-------------------------------------------------------------------*/ diff --git a/harbour/extras/gtwvw/wvwpush.c b/harbour/extras/gtwvw/wvwpush.c index 3b2210883d..9c7dc07c84 100644 --- a/harbour/extras/gtwvw/wvwpush.c +++ b/harbour/extras/gtwvw/wvwpush.c @@ -635,8 +635,8 @@ HB_FUNC( WVW_CBCREATE) AddControlHandle(usWinNum, WVW_CONTROL_COMBOBOX, hWndCB, uiCBid, (PHB_ITEM) hb_param( 6, HB_IT_BLOCK ), rXB, rOffXB, (byte) bKbdType); - OldProc = (WNDPROC) SetWindowLong (hWndCB, - GWL_WNDPROC, (LONG) hb_gt_wvwCBProc) ; + OldProc = (WNDPROC) SetWindowLongPtr (hWndCB, + GWLP_WNDPROC, (LONG_PTR) hb_gt_wvwCBProc) ; StoreControlProc(usWinNum, WVW_CONTROL_COMBOBOX, hWndCB, OldProc); diff --git a/harbour/extras/gtwvw/wvwstbar.c b/harbour/extras/gtwvw/wvwstbar.c index deff3794f0..499681c4be 100644 --- a/harbour/extras/gtwvw/wvwstbar.c +++ b/harbour/extras/gtwvw/wvwstbar.c @@ -577,8 +577,8 @@ HB_FUNC( WVW_XBCREATE) AddControlHandle(usWinNum, WVW_CONTROL_SCROLLBAR, hWndXB, uiXBid, (PHB_ITEM) hb_param( 6, HB_IT_BLOCK ), rXB, rOffXB, (byte) iStyle); - OldProc = (WNDPROC) SetWindowLong (hWndXB, - GWL_WNDPROC, (LONG) hb_gt_wvwXBProc) ; + OldProc = (WNDPROC) SetWindowLongPtr (hWndXB, + GWLP_WNDPROC, (LONG_PTR) hb_gt_wvwXBProc) ; StoreControlProc(usWinNum, WVW_CONTROL_SCROLLBAR, hWndXB, OldProc); diff --git a/harbour/extras/gtwvw/wvwtbar.c b/harbour/extras/gtwvw/wvwtbar.c index c3533d5329..6a9d04d678 100644 --- a/harbour/extras/gtwvw/wvwtbar.c +++ b/harbour/extras/gtwvw/wvwtbar.c @@ -160,8 +160,8 @@ HB_FUNC( WVW_TBCREATE) hb_retnl(0); } - pWindowData->tbOldProc = (WNDPROC) SetWindowLong (hWndTB, - GWL_WNDPROC, (LONG) hb_gt_wvwTBProc) ; + pWindowData->tbOldProc = (WNDPROC) SetWindowLongPtr (hWndTB, + GWLP_WNDPROC, (LONG_PTR) hb_gt_wvwTBProc) ; if (iSystemBitmap > 0) {