Ticket #7271: wxWidgets-2.8.12-mingw64-1.patch

File wxWidgets-2.8.12-mingw64-1.patch, 21.9 KB (added by Tommy Wu, 9 years ago)

remove some un-necessary cast from int64 to int32

  • wxWidgets-2.8.12

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/configure wxWidgets-2.8.12.patched/configure
    old new  
    2780527805
    2780627806            case "${host}" in
    2780727807    x86_64-*-mingw32* )
    27808                         LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lwctl3d32 -ladvapi32 -lwsock32 -lgdi32"
     27808                        LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lws2_32 -lgdi32"
    2780927809        ;;
    2781027810        * )
    27811             LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32"
     27811            LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lws2_32 -lgdi32"
    2781227812        ;;
    2781327813    esac
    2781427814    if test "$wxUSE_ACCESSIBILITY" = "yes" ; then
  • include/wx/msw/menuitem.h

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/include/wx/msw/menuitem.h wxWidgets-2.8.12.patched/include/wx/msw/menuitem.h
    old new  
    5454    // the id for a popup menu is really its menu handle (as required by
    5555    // ::AppendMenu() API), so this function will return either the id or the
    5656    // menu handle depending on what we're
    57     int GetRealId() const;
     57    WXWPARAM GetRealId() const;
    5858
    5959    // mark item as belonging to the given radio group
    6060    void SetAsRadioGroupStart();
  • src/aui/framemanager.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/aui/framemanager.cpp wxWidgets-2.8.12.patched/src/aui/framemanager.cpp
    old new  
    974974    if (pinfo.name.empty() || already_exists)
    975975    {
    976976        pinfo.name.Printf(wxT("%08lx%08x%08x%08lx"),
    977              ((unsigned long)pinfo.window) & 0xffffffff,
     977             ((unsigned long)(intptr_t)pinfo.window) & 0xffffffff,
    978978             (unsigned int)time(NULL),
    979979#ifdef __WXWINCE__
    980980             (unsigned int)GetTickCount(),
  • src/common/debugrpt.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/common/debugrpt.cpp wxWidgets-2.8.12.patched/src/common/debugrpt.cpp
    old new  
    5454    #include "wx/zipstrm.h"
    5555#endif // wxUSE_ZIPSTREAM
    5656
     57#include <direct.h>
     58
    5759WX_CHECK_BUILD_OPTIONS("wxQA")
    5860
    5961// ----------------------------------------------------------------------------
  • src/common/filefn.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/common/filefn.cpp wxWidgets-2.8.12.patched/src/common/filefn.cpp
    old new  
    7070        #endif
    7171    #endif // __GNUWIN32__
    7272
     73    #include <direct.h>
     74
    7375    // io.h is needed for _get_osfhandle()
    7476    // Already included by filefn.h for many Windows compilers
    7577    #if defined __MWERKS__ || defined __CYGWIN__
  • src/common/utilscmn.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/common/utilscmn.cpp wxWidgets-2.8.12.patched/src/common/utilscmn.cpp
    old new  
    822822    //hInstApp member is only valid if the function fails, in which case it
    823823    //receives one of the following error values, which are less than or
    824824    //equal to 32.
    825     const int nResult = (int) sei.hInstApp;
     825    const intptr_t nResult = (intptr_t)sei.hInstApp;
    826826
    827827    // Firefox returns file not found for some reason, so make an exception
    828828    // for it
  • src/msw/dcprint.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/dcprint.cpp wxWidgets-2.8.12.patched/src/msw/dcprint.cpp
    old new  
    319319    }
    320320
    321321
    322     HGLOBAL hDevMode = (HGLOBAL)(DWORD) data->GetDevMode();
     322    HGLOBAL hDevMode = (HGLOBAL) data->GetDevMode();
    323323
    324324    DEVMODE *lpDevMode = hDevMode ? (DEVMODE *)::GlobalLock(hDevMode) : NULL;
    325325
  • src/msw/frame.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/frame.cpp wxWidgets-2.8.12.patched/src/msw/frame.cpp
    old new  
    855855            HDC hdc = ::BeginPaint(GetHwnd(), &ps);
    856856
    857857            // Erase background before painting or we get white background
    858             MSWDefWindowProc(WM_ICONERASEBKGND, (WORD)(LONG)ps.hdc, 0L);
     858            MSWDefWindowProc(WM_ICONERASEBKGND, (intptr_t)ps.hdc, 0L);
    859859
    860860            if ( hIcon )
    861861            {
     
    10851085                const wxIcon& icon = GetIcon();
    10861086                HICON hIcon = icon.Ok() ? GetHiconOf(icon)
    10871087                                        : (HICON)GetDefaultIcon();
    1088                 rc = (long)hIcon;
     1088                rc = (intptr_t)hIcon; // WXLRESULT is int64 in win64
    10891089                processed = rc != 0;
    10901090            }
    10911091            break;
  • src/msw/helpwin.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/helpwin.cpp wxWidgets-2.8.12.patched/src/msw/helpwin.cpp
    old new  
    9898
    9999    wxString str = GetValidFilename(m_helpFile);
    100100
    101     return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k) != 0);
     101    return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_PARTIALKEY, (intptr_t)(const wxChar*) k) != 0);
    102102}
    103103
    104104// Can't close the help window explicitly in WinHelp
  • src/msw/mdi.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/mdi.cpp wxWidgets-2.8.12.patched/src/msw/mdi.cpp
    old new  
    763763  wxWindowCreationHook hook(this);
    764764
    765765  m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
    766                                  WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
     766                                 WM_MDICREATE, 0, (intptr_t)&mcs);
    767767
    768768  if ( !m_hWnd )
    769769  {
     
    14331433            {
    14341434                success = true;
    14351435                ::InsertMenu(hmenu, i, MF_BYPOSITION | MF_POPUP | MF_STRING,
    1436                              (UINT)subMenu, _("&Window"));
     1436                             (intptr_t)subMenu, _("&Window"));
    14371437                break;
    14381438            }
    14391439        }
    14401440
    14411441        if ( !success )
    14421442        {
    1443             ::AppendMenu(hmenu, MF_POPUP, (UINT)subMenu, _("&Window"));
     1443            ::AppendMenu(hmenu, MF_POPUP, (intptr_t)subMenu, _("&Window"));
    14441444        }
    14451445    }
    14461446
  • src/msw/menu.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/menu.cpp wxWidgets-2.8.12.patched/src/msw/menu.cpp
    old new  
    370370
    371371    // id is the numeric id for normal menu items and HMENU for submenus as
    372372    // required by ::AppendMenu() API
    373     UINT id;
     373    UINT_PTR id;
    374374    wxMenu *submenu = pItem->GetSubMenu();
    375375    if ( submenu != NULL ) {
    376376        wxASSERT_MSG( submenu->GetHMenu(), wxT("invalid submenu") );
    377377
    378378        submenu->SetParent(this);
    379379
    380         id = (UINT)submenu->GetHMenu();
     380        id = (intptr_t)submenu->GetHMenu();
    381381
    382382        flags |= MF_POPUP;
    383383    }
    384384    else {
    385         id = pItem->GetId();
     385        id = pItem->GetRealId();
    386386    }
    387387
    388388
     
    963963        for ( i = 0, it = m_menus.begin(); i < count; i++, it++ )
    964964        {
    965965            if ( !::AppendMenu((HMENU)m_hMenu, MF_POPUP | MF_STRING,
    966                                (UINT)(*it)->GetHMenu(),
     966                               (intptr_t)(*it)->GetHMenu(),
    967967                               m_titles[i]) )
    968968            {
    969969                wxLogLastError(wxT("AppendMenu"));
     
    10351035
    10361036    int mswpos = MSWPositionForWxMenu(GetMenu(pos),pos);
    10371037
    1038     UINT id;
     1038    UINT_PTR id;
    10391039    UINT flagsOld = ::GetMenuState((HMENU)m_hMenu, mswpos, MF_BYPOSITION);
    10401040    if ( flagsOld == 0xFFFFFFFF )
    10411041    {
     
    10481048    {
    10491049        // HIBYTE contains the number of items in the submenu in this case
    10501050        flagsOld &= 0xff;
    1051         id = (UINT)::GetSubMenu((HMENU)m_hMenu, mswpos);
     1051        id = (intptr_t)::GetSubMenu((HMENU)m_hMenu, mswpos);
    10521052    }
    10531053    else
    10541054    {
     
    11241124
    11251125        if ( !::InsertMenu(GetHmenu(), (UINT)mswpos,
    11261126                           MF_BYPOSITION | MF_POPUP | MF_STRING,
    1127                            (UINT)GetHmenuOf(menu), title) )
     1127                           (intptr_t)GetHmenuOf(menu), title) )
    11281128        {
    11291129            wxLogLastError(wxT("InsertMenu"));
    11301130        }
     
    11911191#else
    11921192        if ( !::InsertMenu(GetHmenu(), mswpos,
    11931193                           MF_BYPOSITION | MF_POPUP | MF_STRING,
    1194                            (UINT)GetHmenuOf(menu), title) )
     1194                           (intptr_t)GetHmenuOf(menu), title) )
    11951195        {
    11961196            wxLogLastError(wxT("InsertMenu"));
    11971197        }
     
    12501250        }
    12511251#else
    12521252        if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING,
    1253                            (UINT)submenu, title) )
     1253                           (intptr_t)submenu, title) )
    12541254        {
    12551255            wxLogLastError(wxT("AppendMenu"));
    12561256        }
  • src/msw/menuitem.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/menuitem.cpp wxWidgets-2.8.12.patched/src/msw/menuitem.cpp
    old new  
    186186// ----
    187187
    188188// return the id for calling Win32 API functions
    189 int wxMenuItem::GetRealId() const
     189WXWPARAM wxMenuItem::GetRealId() const
    190190{
    191     return m_subMenu ? (int)m_subMenu->GetHMenu() : GetId();
     191    // we must use ids in unsigned short range with Windows functions, if we
     192    // pass ids > USHRT_MAX to them they get very confused (e.g. start
     193    // generating WM_COMMAND messages with negative high word of wParam), so
     194    // use the cast to ensure the id is in range
     195    return m_subMenu ? (intptr_t)m_subMenu->GetHMenu()
     196                     : static_cast<unsigned short>(GetId());
    192197}
    193198
    194199// get item state
  • src/msw/pen.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/pen.cpp wxWidgets-2.8.12.patched/src/msw/pen.cpp
    old new  
    172172           case wxSTIPPLE:
    173173               logb.lbStyle = BS_PATTERN ;
    174174               if (M_PENDATA->m_stipple.Ok())
    175                    logb.lbHatch = (LONG)M_PENDATA->m_stipple.GetHBITMAP();
     175                   logb.lbHatch = (intptr_t)M_PENDATA->m_stipple.GetHBITMAP();
    176176               else
    177                    logb.lbHatch = (LONG)0;
     177                   logb.lbHatch = (intptr_t)0;
    178178               break;
    179179           case wxBDIAGONAL_HATCH:
    180180               logb.lbStyle = BS_HATCHED;
  • src/msw/printdlg.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/printdlg.cpp wxWidgets-2.8.12.patched/src/msw/printdlg.cpp
    old new  
    175175
    176176wxWindowsPrintNativeData::~wxWindowsPrintNativeData()
    177177{
    178     HGLOBAL hDevMode = (HGLOBAL)(DWORD) m_devMode;
     178    HGLOBAL hDevMode = (HGLOBAL) m_devMode;
    179179    if ( hDevMode )
    180180        GlobalFree(hDevMode);
    181     HGLOBAL hDevNames = (HGLOBAL)(DWORD) m_devNames;
     181    HGLOBAL hDevNames = (HGLOBAL) m_devNames;
    182182    if ( hDevNames )
    183183        GlobalFree(hDevNames);
    184184}
     
    190190
    191191bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data )
    192192{
    193     HGLOBAL hDevMode = (HGLOBAL)(DWORD) m_devMode;
    194     HGLOBAL hDevNames = (HGLOBAL)(DWORD) m_devNames;
     193    HGLOBAL hDevMode = (HGLOBAL) m_devMode;
     194    HGLOBAL hDevNames = (HGLOBAL) m_devNames;
    195195
    196196    if (!hDevMode)
    197197    {
     
    396396
    397397bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data )
    398398{
    399     HGLOBAL hDevMode = (HGLOBAL)(DWORD) m_devMode;
    400     HGLOBAL hDevNames = (HGLOBAL)(DWORD) m_devNames;
     399    HGLOBAL hDevMode = (HGLOBAL) m_devMode;
     400    HGLOBAL hDevNames = (HGLOBAL) m_devNames;
    401401    WinPrinter printer;
    402402    LPTSTR szPrinterName = (LPTSTR)data.GetPrinterName().wx_str();
    403403
     
    493493        else
    494494        {
    495495            hDevMode = pd.hDevMode;
    496             m_devMode = (void*)(long) hDevMode;
     496            m_devMode = (void*)(intptr_t) hDevMode;
    497497            pd.hDevMode = NULL;
    498498
    499499            // We'll create a new DEVNAMEs structure below.
     
    502502            pd.hDevNames = NULL;
    503503
    504504            // hDevNames = pd->hDevNames;
    505             // m_devNames = (void*)(long) hDevNames;
     505            // m_devNames = (void*)(intptr_t) hDevNames;
    506506            // pd->hDevnames = NULL;
    507507
    508508        }
     
    688688    }
    689689
    690690    // TODO: I hope it's OK to pass some empty strings to DEVNAMES.
    691     m_devNames = (void*) (long) wxCreateDevNames(wxEmptyString, data.GetPrinterName(), wxEmptyString);
     691    m_devNames = (void*) (intptr_t) wxCreateDevNames(wxEmptyString, data.GetPrinterName(), wxEmptyString);
    692692
    693693    return true;
    694694}
     
    820820    if (pd->hDevNames)
    821821        GlobalFree(pd->hDevNames);
    822822
    823     pd->hDevMode = (HGLOBAL)(DWORD) native_data->GetDevMode();
     823    pd->hDevMode = (HGLOBAL) native_data->GetDevMode();
    824824    native_data->SetDevMode( (void*) NULL);
    825825
    826826    // Shouldn't assert; we should be able to test Ok-ness at a higher level
    827827    //wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!"));
    828828
    829     pd->hDevNames = (HGLOBAL)(DWORD) native_data->GetDevNames();
     829    pd->hDevNames = (HGLOBAL) native_data->GetDevNames();
    830830    native_data->SetDevNames( (void*) NULL);
    831831
    832832
     
    897897        if (native_data->GetDevMode())
    898898        {
    899899            // Make sure we don't leak memory
    900             GlobalFree( (HGLOBAL)(DWORD) native_data->GetDevMode() );
     900            GlobalFree( (HGLOBAL) native_data->GetDevMode() );
    901901        }
    902         native_data->SetDevMode( (void*)(long) pd->hDevMode );
     902        native_data->SetDevMode( (void*)(intptr_t) pd->hDevMode );
    903903        pd->hDevMode = NULL;
    904904    }
    905905
     
    909909        if (native_data->GetDevNames())
    910910        {
    911911            // Make sure we don't leak memory
    912             GlobalFree((HGLOBAL)(DWORD) native_data->GetDevNames());
     912            GlobalFree((HGLOBAL) native_data->GetDevNames());
    913913        }
    914         native_data->SetDevNames((void*)(long) pd->hDevNames);
     914        native_data->SetDevNames((void*)(intptr_t) pd->hDevNames);
    915915        pd->hDevNames = NULL;
    916916    }
    917917
  • src/msw/tbar95.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/tbar95.cpp wxWidgets-2.8.12.patched/src/msw/tbar95.cpp
    old new  
    802802                TBREPLACEBITMAP replaceBitmap;
    803803                replaceBitmap.hInstOld = NULL;
    804804                replaceBitmap.hInstNew = NULL;
    805                 replaceBitmap.nIDOld = (UINT) oldToolBarBitmap;
    806                 replaceBitmap.nIDNew = (UINT) hBitmap;
     805                replaceBitmap.nIDOld = (intptr_t) oldToolBarBitmap;
     806                replaceBitmap.nIDNew = (intptr_t) hBitmap;
    807807                replaceBitmap.nButtons = nButtons;
    808808                if ( !::SendMessage(GetHwnd(), TB_REPLACEBITMAP,
    809809                                    0, (LPARAM) &replaceBitmap) )
     
    832832        {
    833833            TBADDBITMAP addBitmap;
    834834            addBitmap.hInst = 0;
    835             addBitmap.nID = (UINT) hBitmap;
     835            addBitmap.nID = (intptr_t) hBitmap;
    836836            if ( ::SendMessage(GetHwnd(), TB_ADDBITMAP,
    837837                               (WPARAM) nButtons, (LPARAM)&addBitmap) == -1 )
    838838            {
     
    912912                {
    913913                    const wxString& label = tool->GetLabel();
    914914                    if ( !label.empty() )
    915                         button.iString = (int)label.c_str();
     915                        button.iString = (intptr_t)label.c_str();
    916916                }
    917917
    918918                button.idCommand = tool->GetId();
  • src/msw/textctrl.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/textctrl.cpp wxWidgets-2.8.12.patched/src/msw/textctrl.cpp
    old new  
    960960    // finally, stream it in the control
    961961    EDITSTREAM eds;
    962962    wxZeroMemory(eds);
    963     eds.dwCookie = (DWORD)&wpc;
     963    eds.dwCookie = (intptr_t)&wpc;
    964964    // the cast below is needed for broken (very) old mingw32 headers
    965965    eds.pfnCallback = (EDITSTREAMCALLBACK)wxRichEditStreamIn;
    966966
     
    10131013
    10141014    EDITSTREAM eds;
    10151015    wxZeroMemory(eds);
    1016     eds.dwCookie = (DWORD)&data;
     1016    eds.dwCookie = (intptr_t)&data;
    10171017    eds.pfnCallback = wxRichEditStreamOut;
    10181018
    10191019    ::SendMessage
  • src/msw/thread.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/thread.cpp wxWidgets-2.8.12.patched/src/msw/thread.cpp
    old new  
    522522            return (THREAD_RETVAL)-1;
    523523        }
    524524
    525         rc = (THREAD_RETVAL)thread->Entry();
     525        rc = (THREAD_RETVAL)(intptr_t)thread->Entry();
    526526    }
    527527    wxCATCH_ALL( wxTheApp->OnUnhandledException(); )
    528528
     
    842842            break;
    843843        }
    844844
    845         if ( (DWORD)rc != STILL_ACTIVE )
     845        if ( (intptr_t)rc != STILL_ACTIVE )
    846846            break;
    847847
    848848        // give the other thread some time to terminate, otherwise we may be
     
    10001000    // could we set all bits?
    10011001    if ( level != 0 )
    10021002    {
    1003         wxLogDebug(_T("bad level %u in wxThread::SetConcurrency()"), level);
     1003        wxLogDebug(_T("bad level %Iu in wxThread::SetConcurrency()"), level);
    10041004
    10051005        return false;
    10061006    }
     
    11621162    }
    11631163
    11641164#ifdef wxUSE_BEGIN_THREAD
    1165     _endthreadex((unsigned)status);
     1165    _endthreadex((unsigned)(intptr_t)status);
    11661166#else // !VC++
    11671167    ::ExitThread((DWORD)status);
    11681168#endif // VC++/!VC++
  • src/msw/tooltip.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/tooltip.cpp wxWidgets-2.8.12.patched/src/msw/tooltip.cpp
    old new  
    106106            uFlags |= TTF_TRANSPARENT;
    107107        }
    108108
    109         uId = (UINT)hwndOwner;
     109        uId = (intptr_t)hwndOwner;
    110110    }
    111111};
    112112
  • src/msw/toplevel.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/toplevel.cpp wxWidgets-2.8.12.patched/src/msw/toplevel.cpp
    old new  
    11221122    {
    11231123        // restore focus to the child which was last focused unless we already
    11241124        // have it
    1125         wxLogTrace(_T("focus"), _T("wxTLW %08x activated."), (int) m_hWnd);
     1125        wxLogTrace(_T("focus"), _T("wxTLW %p activated."), (intptr_t) m_hWnd);
    11261126
    11271127        wxWindow *winFocus = FindFocus();
    11281128        if ( !winFocus || wxGetTopLevelParent(winFocus) != this )
     
    11571157        }
    11581158
    11591159        wxLogTrace(_T("focus"),
    1160                    _T("wxTLW %08x deactivated, last focused: %08x."),
    1161                    (int) m_hWnd,
    1162                    (int) (m_winLastFocused ? GetHwndOf(m_winLastFocused)
     1160                   _T("wxTLW %p deactivated, last focused: %p."),
     1161                   (intptr_t) m_hWnd,
     1162                   (intptr_t) (m_winLastFocused ? GetHwndOf(m_winLastFocused)
    11631163                                           : NULL));
    11641164
    11651165        event.Skip();
  • src/msw/utils.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/utils.cpp wxWidgets-2.8.12.patched/src/msw/utils.cpp
    old new  
    713713        return -1;
    714714    }
    715715
    716     wxON_BLOCK_EXIT1(::CloseHandle, hProcess);
     716    wxON_BLOCK_EXIT1((WINBOOL (*)(void *))::CloseHandle, hProcess);
    717717
    718718    bool ok = true;
    719719    switch ( sig )
  • src/msw/window.cpp

    diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/window.cpp wxWidgets-2.8.12.patched/src/msw/window.cpp
    old new  
    25962596    // trace all messages - useful for the debugging
    25972597#ifdef __WXDEBUG__
    25982598    wxLogTrace(wxTraceMessages,
    2599                wxT("Processing %s(hWnd=%08lx, wParam=%8lx, lParam=%8lx)"),
    2600                wxGetMessageName(message), (long)hWnd, (long)wParam, lParam);
     2599               wxT("Processing %s(hWnd=%Ix, wParam=%Ix, lParam=%Ix)"),
     2600               wxGetMessageName(message), (intptr_t)hWnd, (intptr_t)wParam, (intptr_t)lParam);
    26012601#endif // __WXDEBUG__
    26022602
    26032603    wxWindowMSW *wnd = wxFindWinFromHandle((WXHWND) hWnd);
     
    34383438
    34393439wxWindow *wxFindWinFromHandle(WXHWND hWnd)
    34403440{
    3441     return (wxWindow*)wxWinHandleHash->Get((long)hWnd);
     3441    return (wxWindow*)wxWinHandleHash->Get((intptr_t)hWnd);
    34423442}
    34433443
    34443444void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win)
     
    34523452#ifdef __WXDEBUG__
    34533453    if ( oldWin && (oldWin != win) )
    34543454    {
    3455         wxLogDebug(wxT("HWND %X already associated with another window (%s)"),
    3456                    (int) hWnd, win->GetClassInfo()->GetClassName());
     3455        wxLogDebug(wxT("HWND %IX already associated with another window (%s)"),
     3456                   (intptr_t) hWnd, win->GetClassInfo()->GetClassName());
    34573457    }
    34583458    else
    34593459#endif // __WXDEBUG__
    34603460    if (!oldWin)
    34613461    {
    3462         wxWinHandleHash->Put((long)hWnd, (wxWindow *)win);
     3462        wxWinHandleHash->Put((intptr_t)hWnd, (wxWindow *)win);
    34633463    }
    34643464}
    34653465
    34663466void wxRemoveHandleAssociation(wxWindowMSW *win)
    34673467{
    3468     wxWinHandleHash->Delete((long)win->GetHWND());
     3468    wxWinHandleHash->Delete((intptr_t)win->GetHWND());
    34693469}
    34703470
    34713471// ----------------------------------------------------------------------------