Win64 compilation fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25704 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
af5b273c11
commit
975b6bcf9b
@ -18,11 +18,14 @@
|
||||
// wxSelectedIndices is just a sorted array of indices
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
inline int CMPFUNC_CONV wxSizeTCmpFn(size_t n1, size_t n2) { return n1 - n2; }
|
||||
inline int CMPFUNC_CONV wxSizeTCmpFn(size_t n1, size_t n2)
|
||||
{
|
||||
return (int)(n1 - n2);
|
||||
}
|
||||
|
||||
WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_LONG(size_t,
|
||||
wxSizeTCmpFn,
|
||||
wxSelectedIndices);
|
||||
WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_SIZE_T(size_t,
|
||||
wxSizeTCmpFn,
|
||||
wxSelectedIndices);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSelectionStore is used to store the selected items in the virtual
|
||||
|
@ -249,7 +249,11 @@ private:
|
||||
// finally, we need this typedef instead of declaring m_buffer directly
|
||||
// because otherwise the assert mentioned above wouldn't compile with some
|
||||
// compilers (notably CodeWarrior 8)
|
||||
#ifdef __WIN64__
|
||||
typedef char wxCritSectBuffer[40];
|
||||
#else // __WIN32__
|
||||
typedef char wxCritSectBuffer[24];
|
||||
#endif
|
||||
union
|
||||
{
|
||||
unsigned long m_dummy1;
|
||||
|
@ -70,10 +70,11 @@ IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
|
||||
// colour dialog hook proc
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
UINT CALLBACK wxColourDialogHookProc(HWND hwnd,
|
||||
UINT uiMsg,
|
||||
WPARAM WXUNUSED(wParam),
|
||||
LPARAM lParam)
|
||||
UINT_PTR CALLBACK
|
||||
wxColourDialogHookProc(HWND hwnd,
|
||||
UINT uiMsg,
|
||||
WPARAM WXUNUSED(wParam),
|
||||
LPARAM lParam)
|
||||
{
|
||||
if ( uiMsg == WM_INITDIALOG )
|
||||
{
|
||||
|
@ -127,7 +127,7 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd,
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// the pointer to standard radio button wnd proc
|
||||
static WXFARPROC gs_wndprocEdit = (WXFARPROC)NULL;
|
||||
static WNDPROC gs_wndprocEdit = (WNDPROC)NULL;
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
@ -409,12 +409,8 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
// edit control, we must subclass it as well
|
||||
if ( !(style & wxCB_READONLY) )
|
||||
{
|
||||
gs_wndprocEdit = (WXFARPROC)::SetWindowLong
|
||||
(
|
||||
(HWND)GetEditHWND(),
|
||||
GWL_WNDPROC,
|
||||
(LPARAM)wxComboEditWndProc
|
||||
);
|
||||
gs_wndprocEdit = wxSetWindowProc((HWND)GetEditHWND(),
|
||||
wxComboEditWndProc);
|
||||
}
|
||||
|
||||
// and finally, show the control
|
||||
|
@ -1073,13 +1073,7 @@ bool wxDialUpManagerMSW::EnableAutoCheckOnlineStatus(size_t nSeconds)
|
||||
}
|
||||
|
||||
// and subclass it
|
||||
FARPROC windowProc = MakeProcInstance
|
||||
(
|
||||
(FARPROC)wxRasStatusWindowProc,
|
||||
wxGetInstance()
|
||||
);
|
||||
|
||||
::SetWindowLong(ms_hwndRas, GWL_WNDPROC, (LONG) windowProc);
|
||||
wxSetWindowProc(ms_hwndRas, wxRasStatusWindowProc);
|
||||
}
|
||||
|
||||
m_data.hWnd = ms_hwndRas;
|
||||
|
@ -50,10 +50,10 @@
|
||||
LRESULT APIENTRY wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg,
|
||||
WPARAM wParam, LPARAM lParam);
|
||||
|
||||
UINT CALLBACK wxFindReplaceDialogHookProc(HWND hwnd,
|
||||
UINT uiMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam);
|
||||
UINT_PTR CALLBACK wxFindReplaceDialogHookProc(HWND hwnd,
|
||||
UINT uiMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
@ -201,14 +201,11 @@ void wxFindReplaceDialogImpl::SubclassDialog(HWND hwnd)
|
||||
// as then we'd have infinite recursion in wxFindReplaceWindowProc
|
||||
if ( !wxCheckWindowWndProc((WXHWND)hwnd, (WXFARPROC)wxFindReplaceWindowProc) )
|
||||
{
|
||||
WNDPROC oldParentWndProc = (WNDPROC)::GetWindowLong(hwnd, GWL_WNDPROC);
|
||||
// save old wnd proc elsewhere to access it from
|
||||
// wxFindReplaceWindowProc
|
||||
m_oldParentWndProc = oldParentWndProc;
|
||||
(void)::SetWindowLong(hwnd, GWL_USERDATA, (LONG)oldParentWndProc);
|
||||
// set the new one and save the old as user data to allow access to it
|
||||
// from wxFindReplaceWindowProc
|
||||
m_oldParentWndProc = wxSetWindowProc(hwnd, wxFindReplaceWindowProc);
|
||||
|
||||
// and set the new one
|
||||
(void)::SetWindowLong(hwnd, GWL_WNDPROC, (LONG)wxFindReplaceWindowProc);
|
||||
wxSetWindowUserData(hwnd, m_oldParentWndProc);
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,7 +216,8 @@ wxFindReplaceDialogImpl::~wxFindReplaceDialogImpl()
|
||||
|
||||
if ( m_hwndOwner )
|
||||
{
|
||||
::SetWindowLong(m_hwndOwner, GWL_WNDPROC, (LONG)m_oldParentWndProc);
|
||||
// undo subclassing
|
||||
wxSetWindowProc(m_hwndOwner, m_oldParentWndProc);
|
||||
}
|
||||
}
|
||||
|
||||
@ -327,7 +325,7 @@ LRESULT APIENTRY wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg,
|
||||
s_lastMsgFlags = 0;
|
||||
#endif // wxUSE_UNICODE_MSLU
|
||||
|
||||
WNDPROC wndProc = (WNDPROC)::GetWindowLong(hwnd, GWL_USERDATA);
|
||||
WNDPROC wndProc = (WNDPROC)wxGetWindowUserData(hwnd);
|
||||
|
||||
// sanity check
|
||||
wxASSERT_MSG( wndProc != wxFindReplaceWindowProc,
|
||||
@ -340,10 +338,11 @@ LRESULT APIENTRY wxFindReplaceWindowProc(HWND hwnd, WXUINT nMsg,
|
||||
// Find/replace dialog hook proc
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
UINT CALLBACK wxFindReplaceDialogHookProc(HWND hwnd,
|
||||
UINT uiMsg,
|
||||
WPARAM WXUNUSED(wParam),
|
||||
LPARAM lParam)
|
||||
UINT_PTR CALLBACK
|
||||
wxFindReplaceDialogHookProc(HWND hwnd,
|
||||
UINT uiMsg,
|
||||
WPARAM WXUNUSED(wParam),
|
||||
LPARAM lParam)
|
||||
{
|
||||
if ( uiMsg == WM_INITDIALOG )
|
||||
{
|
||||
|
@ -782,10 +782,10 @@ void wxRadioBox::SubclassRadioButton(WXHWND hWndBtn)
|
||||
HWND hwndBtn = (HWND)hWndBtn;
|
||||
|
||||
if ( !s_wndprocRadioBtn )
|
||||
s_wndprocRadioBtn = (WXFARPROC)::GetWindowLong(hwndBtn, GWL_WNDPROC);
|
||||
s_wndprocRadioBtn = (WXFARPROC)wxGetWindowProc(hwndBtn);
|
||||
|
||||
::SetWindowLong(hwndBtn, GWL_WNDPROC, (long)wxRadioBtnWndProc);
|
||||
::SetWindowLong(hwndBtn, GWL_USERDATA, (long)this);
|
||||
wxSetWindowProc(hwndBtn, wxRadioBtnWndProc);
|
||||
wxSetWindowUserData(hwndBtn, this);
|
||||
}
|
||||
|
||||
void wxRadioBox::SendNotificationEvent()
|
||||
@ -933,8 +933,8 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
|
||||
NMHDR* hdr = (NMHDR *)lParam;
|
||||
if ( hdr->code == TTN_NEEDTEXT )
|
||||
{
|
||||
wxRadioBox *radiobox = (wxRadioBox *)
|
||||
::GetWindowLong(hwnd, GWL_USERDATA);
|
||||
wxRadioBox *
|
||||
radiobox = (wxRadioBox *)wxGetWindowUserData(hwnd);
|
||||
|
||||
wxCHECK_MSG( radiobox, 0,
|
||||
wxT("radio button without radio box?") );
|
||||
@ -955,8 +955,7 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
|
||||
|
||||
case WM_KEYDOWN:
|
||||
{
|
||||
wxRadioBox *radiobox = (wxRadioBox *)
|
||||
::GetWindowLong(hwnd, GWL_USERDATA);
|
||||
wxRadioBox *radiobox = (wxRadioBox *)wxGetWindowUserData(hwnd);
|
||||
|
||||
wxCHECK_MSG( radiobox, 0, wxT("radio button without radio box?") );
|
||||
|
||||
@ -1015,8 +1014,7 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
|
||||
case WM_SETFOCUS:
|
||||
case WM_KILLFOCUS:
|
||||
{
|
||||
wxRadioBox *radiobox = (wxRadioBox *)
|
||||
::GetWindowLong(hwnd, GWL_USERDATA);
|
||||
wxRadioBox *radiobox = (wxRadioBox *)wxGetWindowUserData(hwnd);
|
||||
|
||||
wxCHECK_MSG( radiobox, 0, wxT("radio button without radio box?") );
|
||||
|
||||
@ -1034,8 +1032,7 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
|
||||
#ifdef __WIN32__
|
||||
case WM_HELP:
|
||||
{
|
||||
wxRadioBox *radiobox = (wxRadioBox *)
|
||||
::GetWindowLong(hwnd, GWL_USERDATA);
|
||||
wxRadioBox *radiobox = (wxRadioBox *)wxGetWindowUserData(hwnd);
|
||||
|
||||
wxCHECK_MSG( radiobox, 0, wxT("radio button without radio box?") );
|
||||
|
||||
|
@ -149,7 +149,7 @@ LRESULT APIENTRY _EXPORT wxBuddyTextWndProc(HWND hwnd,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
wxSpinCtrl *spin = (wxSpinCtrl *)::GetWindowLong(hwnd, GWL_USERDATA);
|
||||
wxSpinCtrl *spin = (wxSpinCtrl *)wxGetWindowUserData(hwnd);
|
||||
|
||||
// forward some messages (the key and focus ones only so far) to
|
||||
// the spin ctrl
|
||||
@ -170,7 +170,7 @@ LRESULT APIENTRY _EXPORT wxBuddyTextWndProc(HWND hwnd,
|
||||
spin->MSWWindowProc(message, wParam, lParam);
|
||||
|
||||
// The control may have been deleted at this point, so check.
|
||||
if (!(::IsWindow(hwnd) && ((wxSpinCtrl *)::GetWindowLong(hwnd, GWL_USERDATA)) == spin))
|
||||
if ( !::IsWindow(hwnd) || wxGetWindowUserData(hwnd) != spin )
|
||||
return 0;
|
||||
break;
|
||||
|
||||
@ -186,8 +186,7 @@ LRESULT APIENTRY _EXPORT wxBuddyTextWndProc(HWND hwnd,
|
||||
/* static */
|
||||
wxSpinCtrl *wxSpinCtrl::GetSpinForTextCtrl(WXHWND hwndBuddy)
|
||||
{
|
||||
wxSpinCtrl *spin = (wxSpinCtrl *)::GetWindowLong((HWND)hwndBuddy,
|
||||
GWL_USERDATA);
|
||||
wxSpinCtrl *spin = (wxSpinCtrl *)wxGetWindowUserData((HWND)hwndBuddy);
|
||||
|
||||
int i = ms_allSpins.Index(spin);
|
||||
|
||||
@ -363,9 +362,9 @@ bool wxSpinCtrl::Create(wxWindow *parent,
|
||||
SetValue(initial);
|
||||
|
||||
// subclass the text ctrl to be able to intercept some events
|
||||
m_wndProcBuddy = (WXFARPROC)::GetWindowLong(GetBuddyHwnd(), GWL_WNDPROC);
|
||||
::SetWindowLong(GetBuddyHwnd(), GWL_USERDATA, (LONG)this);
|
||||
::SetWindowLong(GetBuddyHwnd(), GWL_WNDPROC, (LONG)wxBuddyTextWndProc);
|
||||
wxSetWindowUserData(GetBuddyHwnd(), this);
|
||||
m_wndProcBuddy = (WXFARPROC)wxSetWindowProc(GetBuddyHwnd(),
|
||||
wxBuddyTextWndProc);
|
||||
|
||||
// should have the same font as the other controls
|
||||
SetFont(GetParent()->GetFont());
|
||||
|
@ -688,7 +688,7 @@ struct wxStreamOutData
|
||||
};
|
||||
|
||||
DWORD CALLBACK
|
||||
wxRichEditStreamOut(DWORD dwCookie, BYTE *buf, LONG cb, LONG *pcb)
|
||||
wxRichEditStreamOut(DWORD_PTR dwCookie, BYTE *buf, LONG cb, LONG *pcb)
|
||||
{
|
||||
*pcb = 0;
|
||||
|
||||
|
@ -902,7 +902,7 @@ bool wxThread::SetConcurrency(size_t level)
|
||||
|
||||
// get system affinity mask first
|
||||
HANDLE hProcess = ::GetCurrentProcess();
|
||||
DWORD dwProcMask, dwSysMask;
|
||||
DWORD_PTR dwProcMask, dwSysMask;
|
||||
if ( ::GetProcessAffinityMask(hProcess, &dwProcMask, &dwSysMask) == 0 )
|
||||
{
|
||||
wxLogLastError(_T("GetProcessAffinityMask"));
|
||||
@ -983,7 +983,8 @@ bool wxThread::SetConcurrency(size_t level)
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#endif // !__WXWINCE__
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -217,8 +217,7 @@ WXHWND wxToolTip::GetToolTipCtrl()
|
||||
|
||||
#if wxUSE_TTM_WINDOWFROMPOINT
|
||||
// subclass the newly created control
|
||||
gs_wndprocToolTip = (WNDPROC)::GetWindowLong(hwnd, GWL_WNDPROC);
|
||||
::SetWindowLong(hwnd, GWL_WNDPROC, (long)wxToolTipWndProc);
|
||||
gs_wndprocToolTip = wxSetWindowProc(hwnd, wxToolTipWndProc);
|
||||
#endif // wxUSE_TTM_WINDOWFROMPOINT
|
||||
}
|
||||
}
|
||||
|
@ -974,13 +974,13 @@ void wxWindowMSW::SubclassWin(WXHWND hWnd)
|
||||
|
||||
wxAssociateWinWithHandle(hwnd, this);
|
||||
|
||||
m_oldWndProc = (WXFARPROC)::GetWindowLong((HWND)hWnd, GWL_WNDPROC);
|
||||
m_oldWndProc = (WXFARPROC)wxGetWindowProc((HWND)hWnd);
|
||||
|
||||
// we don't need to subclass the window of our own class (in the Windows
|
||||
// sense of the word)
|
||||
if ( !wxCheckWindowWndProc(hWnd, (WXFARPROC)wxWndProc) )
|
||||
{
|
||||
::SetWindowLong(hwnd, GWL_WNDPROC, (LONG) wxWndProc);
|
||||
wxSetWindowProc(hwnd, wxWndProc);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1008,7 +1008,7 @@ void wxWindowMSW::UnsubclassWin()
|
||||
{
|
||||
if ( !wxCheckWindowWndProc((WXHWND)hwnd, m_oldWndProc) )
|
||||
{
|
||||
::SetWindowLong(hwnd, GWL_WNDPROC, (LONG) m_oldWndProc);
|
||||
wxSetWindowProc(hwnd, (WNDPROC)m_oldWndProc);
|
||||
}
|
||||
|
||||
m_oldWndProc = NULL;
|
||||
@ -3678,8 +3678,13 @@ wxWindowMSW::MSWOnMeasureItem(int WXUNUSED_UNLESS_ODRAWN(id),
|
||||
|
||||
wxCHECK( pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), FALSE );
|
||||
|
||||
return pMenuItem->OnMeasureItem(&pMeasureStruct->itemWidth,
|
||||
&pMeasureStruct->itemHeight);
|
||||
size_t w, h;
|
||||
bool rc = pMenuItem->OnMeasureItem(&w, &h);
|
||||
|
||||
pMeasureStruct->itemWidth = w;
|
||||
pMeasureStruct->itemHeight = h;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
wxControl *item = wxDynamicCast(FindItem(id), wxControl);
|
||||
@ -5103,7 +5108,7 @@ extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd)
|
||||
// do it as well, win would be already non NULL
|
||||
if ( ::SendMessage(hwnd, WM_GETDLGCODE, 0, 0) & DLGC_RADIOBUTTON )
|
||||
{
|
||||
win = (wxWindow *)::GetWindowLong(hwnd, GWL_USERDATA);
|
||||
win = (wxWindow *)wxGetWindowUserData(hwnd);
|
||||
}
|
||||
//else: it's a wxRadioButton, not a radiobutton from wxRadioBox
|
||||
#endif // wxUSE_RADIOBOX
|
||||
|
Loading…
Reference in New Issue
Block a user