From c4e7c2aa5822f9a6e97d8d7848b95ea2eadcd98b Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 17 Jul 1998 09:32:24 +0000 Subject: [PATCH] Added STRICT corrections. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/private.h | 3 ++- src/common/cmndata.cpp | 2 +- src/common/datstrm.cpp | 2 ++ src/msw/app.cpp | 8 ++++---- src/msw/bmpbuttn.cpp | 8 ++++---- src/msw/clipbrd.cpp | 12 ++++++------ src/msw/curico.cpp | 4 ++-- src/msw/dcmemory.cpp | 2 +- src/msw/dib.cpp | 2 +- src/msw/frame.cpp | 2 +- src/msw/gaugemsw.cpp | 16 ++++++++-------- src/msw/listbox.cpp | 4 ++-- src/msw/main.cpp | 2 +- src/msw/makefile.b32 | 2 +- src/msw/makefile.nt | 3 ++- src/msw/mdi.cpp | 6 +++--- src/msw/metafile.cpp | 4 ++-- src/msw/minifram.cpp | 14 +++++++------- src/msw/ownerdrw.cpp | 4 ++-- src/msw/pnghand.cpp | 4 ++-- src/msw/printwin.cpp | 2 +- src/msw/statbmp.cpp | 2 +- src/msw/tbar95.cpp | 6 +++--- src/msw/tbarmsw.cpp | 16 ++++++++-------- src/msw/textctrl.cpp | 2 +- src/msw/window.cpp | 6 +++--- src/ntwxwin.mak | 4 ++-- 27 files changed, 73 insertions(+), 69 deletions(-) diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 5a3635e748..4e81d182ef 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -40,7 +40,8 @@ wxFont WXDLLEXPORT wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNe #ifdef __GNUWIN32__ #define CASTWNDPROC (long unsigned) #else -#define CASTWNDPROC +typedef long (_stdcall * WndProcCast) (HWND, unsigned int, unsigned int, long); +#define CASTWNDPROC (WndProcCast) #endif #if !defined(APIENTRY) // NT defines APIENTRY, 3.x not diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index b3e4eb2c21..19d2589a38 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -387,7 +387,7 @@ void wxPageSetupData::ConvertToNative(void) pd->Flags |= PSD_SHOWHELP; pd->lStructSize = sizeof( PAGESETUPDLG ); - pd->hwndOwner=(HANDLE)NULL; + pd->hwndOwner=(HWND)NULL; pd->hDevNames=(HWND)NULL; pd->hInstance=(HINSTANCE)NULL; diff --git a/src/common/datstrm.cpp b/src/common/datstrm.cpp index f5fdaa1bd4..fa1eaa7d89 100644 --- a/src/common/datstrm.cpp +++ b/src/common/datstrm.cpp @@ -26,10 +26,12 @@ #include "wx/datstrm.h" +/* #if !USE_SHARED_LIBRARY IMPLEMENT_CLASS(wxDataInputStream, wxFilterInputStream) IMPLEMENT_CLASS(wxDataOutputStream, wxFilterOutputStream) #endif +*/ wxDataInputStream::wxDataInputStream(wxInputStream& s) : wxFilterInputStream(s) diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 12111a86fc..47b65da5b4 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -59,7 +59,7 @@ extern wxList wxPendingDelete; extern void wxSetKeyboardHook(bool doIt); extern wxCursor *g_globalCursor; -HANDLE wxhInstance = 0; +HINSTANCE wxhInstance = 0; static MSG s_currentMsg; wxApp *wxTheApp = NULL; @@ -94,9 +94,9 @@ long wxApp::sm_lastMessageTime = 0; static HINSTANCE gs_hRichEdit = NULL; #endif -bool wxApp::Initialize(WXHANDLE instance) +bool wxApp::Initialize(WXHINSTANCE instance) { - HANDLE hInstance = (HANDLE)instance; + HINSTANCE hInstance = (HINSTANCE) instance; CommonInit(); @@ -248,7 +248,7 @@ bool wxApp::RegisterWindowClasses() wndclass2.hIcon = NULL; wndclass2.hCursor = NULL; // wndclass2.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1) ; - wndclass2.hbrBackground = GetStockObject( LTGRAY_BRUSH ); + wndclass2.hbrBackground = (HBRUSH) GetStockObject( LTGRAY_BRUSH ); wndclass2.lpszMenuName = NULL; wndclass2.lpszClassName = wxPanelClassName; if (!RegisterClass( &wndclass2 )) diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index ec5733df7b..1c1b95c7c3 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -130,7 +130,7 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item) HDC hDC = lpDIS->hDC; HDC memDC = ::CreateCompatibleDC(hDC); - HBITMAP old = ::SelectObject(memDC, (HBITMAP) bitmap->GetHBITMAP()); + HBITMAP old = (HBITMAP) ::SelectObject(memDC, (HBITMAP) bitmap->GetHBITMAP()); if (!old) return FALSE; @@ -194,8 +194,8 @@ void wxBitmapButton::DrawFace( WXHDC dc, int left, int top, int right, int botto ms_color = GetSysColor(COLOR_BTNFACE) ; brushFace = CreateSolidBrush(ms_color) ; - oldp = SelectObject( (HDC) dc, GetStockObject( NULL_PEN ) ) ; - oldb = SelectObject( (HDC) dc, brushFace ) ; + oldp = (HPEN) SelectObject( (HDC) dc, GetStockObject( NULL_PEN ) ) ; + oldb = (HBRUSH) SelectObject( (HDC) dc, brushFace ) ; Rectangle( (HDC) dc, left, top, right, bottom ) ; SelectObject( (HDC) dc, penBorder) ; MoveToEx((HDC) dc,left+1,top,NULL);LineTo((HDC) dc,right-1,top); @@ -252,7 +252,7 @@ void wxBitmapButton::DrawButtonFocus( WXHDC dc, int left, int top, int right, in extern HBRUSH wxDisableButtonBrush; void wxBitmapButton::DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg ) { - HBRUSH old = SelectObject( (HDC) dc, wxDisableButtonBrush ) ; + HBRUSH old = (HBRUSH) SelectObject( (HDC) dc, wxDisableButtonBrush ) ; if ( with_marg ) ::PatBlt( (HDC) dc, left + m_marginX, top + m_marginY, diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index af48db1a5a..8ee3cc7593 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -92,7 +92,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height) HDC hdcMem = CreateCompatibleDC(NULL); HDC hdcSrc = CreateCompatibleDC(NULL); - HBITMAP old = ::SelectObject(hdcSrc, (HBITMAP) wxBM->GetHBITMAP()); + HBITMAP old = (HBITMAP) ::SelectObject(hdcSrc, (HBITMAP) wxBM->GetHBITMAP()); HBITMAP hBitmap = CreateCompatibleBitmap(hdcSrc, wxBM->GetWidth(), wxBM->GetHeight()); if (!hBitmap) @@ -102,7 +102,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height) DeleteDC(hdcSrc); return FALSE; } - HBITMAP old1 = SelectObject(hdcMem, hBitmap); + HBITMAP old1 = (HBITMAP) SelectObject(hdcMem, hBitmap); BitBlt(hdcMem, 0, 0, wxBM->GetWidth(), wxBM->GetHeight(), hdcSrc, 0, 0, SRCCOPY); @@ -145,7 +145,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height) mf->mm = wxMF->GetWindowsMappingMode(); mf->xExt = width; mf->yExt = height; - mf->hMF = (HANDLE) wxMF->GetHMETAFILE(); + mf->hMF = (HMETAFILE) wxMF->GetHMETAFILE(); GlobalUnlock(data); wxMF->SetHMETAFILE((WXHANDLE) NULL); @@ -206,14 +206,14 @@ wxObject *wxGetClipboardData(int dataFormat, long *len) case wxCF_BITMAP: { BITMAP bm; - HBITMAP hBitmap = GetClipboardData(CF_BITMAP); + HBITMAP hBitmap = (HBITMAP) GetClipboardData(CF_BITMAP); if (!hBitmap) return NULL; HDC hdcMem = CreateCompatibleDC(NULL); HDC hdcSrc = CreateCompatibleDC(NULL); - HBITMAP old = ::SelectObject(hdcSrc, hBitmap); + HBITMAP old = (HBITMAP) ::SelectObject(hdcSrc, hBitmap); GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm); HBITMAP hNewBitmap = CreateBitmapIndirect(&bm); @@ -226,7 +226,7 @@ wxObject *wxGetClipboardData(int dataFormat, long *len) return NULL; } - HBITMAP old1 = SelectObject(hdcMem, hNewBitmap); + HBITMAP old1 = (HBITMAP) SelectObject(hdcMem, hNewBitmap); BitBlt(hdcMem, 0, 0, bm.bmWidth, bm.bmHeight, hdcSrc, 0, 0, SRCCOPY); diff --git a/src/msw/curico.cpp b/src/msw/curico.cpp index 7644dead8a..854a6a65ab 100644 --- a/src/msw/curico.cpp +++ b/src/msw/curico.cpp @@ -772,7 +772,7 @@ HCURSOR MakeCursorFromBitmap(HINSTANCE hInst, HBITMAP hBitmap, POINT *pPoint) hAndBmp = CreateCompatibleBitmap(hDCMono, 32, 32); hXorBmp = CreateCompatibleBitmap(hDCMono, 32, 32); - hBmpOld = SelectObject(hDCColor, hBitmap); + hBmpOld = (HBITMAP) SelectObject(hDCColor, hBitmap); SelectObject(hDCMono, hAndBmp); SetBkColor(hDCColor, RGB(191, 191, 191)); @@ -849,7 +849,7 @@ HICON MakeIconFromBitmap(HINSTANCE hInst, HBITMAP hBitmap) hAndBmp = CreateCompatibleBitmap(hDCMono, 32, 32); hXorBmp = CreateCompatibleBitmap(hDCMono, 32, 32); - hBmpOld = SelectObject(hDCColor, hBitmap); + hBmpOld = (HBITMAP) SelectObject(hDCColor, hBitmap); SelectObject(hDCMono, hAndBmp); SetBkColor(hDCColor, RGB(191, 191, 191)); diff --git a/src/msw/dcmemory.cpp b/src/msw/dcmemory.cpp index 42e0a0b97a..a89b217bcb 100644 --- a/src/msw/dcmemory.cpp +++ b/src/msw/dcmemory.cpp @@ -94,7 +94,7 @@ void wxMemoryDC::SelectObject(const wxBitmap& bitmap) #if WXDEBUG > 1 wxDebugMsg("wxMemoryDC::SelectObject: Selecting HBITMAP %X\n", m_selectedBitmap.GetHBITMAP()); #endif - HBITMAP bm = ::SelectObject((HDC) m_hDC, (HBITMAP) m_selectedBitmap.GetHBITMAP()); + HBITMAP bm = (HBITMAP) ::SelectObject((HDC) m_hDC, (HBITMAP) m_selectedBitmap.GetHBITMAP()); if (bm == ERROR) { diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index 58d92874cb..d86337576a 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -682,7 +682,7 @@ HPALETTE MakeDIBPalette(LPBITMAPINFOHEADER lpInfo) ** some good color choices. */ else - return(GetStockObject(DEFAULT_PALETTE)); + return((HPALETTE) GetStockObject(DEFAULT_PALETTE)); } bool wxLoadIntoBitmap(char *filename, wxBitmap *bitmap, wxColourMap **pal) diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 8adcf37a44..8140982c51 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -739,7 +739,7 @@ void wxFrame::MSWOnMenuHighlight(WXWORD nItem, WXWORD nFlags, WXHMENU hSysMenu) bool wxFrame::MSWProcessMessage(WXMSG* pMsg) { if (m_acceleratorTable != 0 && - ::TranslateAccelerator((HWND) GetHWND(), (HANDLE) m_acceleratorTable, (MSG *)pMsg)) + ::TranslateAccelerator((HWND) GetHWND(), (HACCEL) m_acceleratorTable, (MSG *)pMsg)) return TRUE; return FALSE; diff --git a/src/msw/gaugemsw.cpp b/src/msw/gaugemsw.cpp index be590a4556..65a4018239 100644 --- a/src/msw/gaugemsw.cpp +++ b/src/msw/gaugemsw.cpp @@ -75,7 +75,7 @@ bool wxGaugeMSW::Create(wxWindow *parent, wxWindowID id, if ( !wxGaugeMSWInitialised ) { - if (!gaugeInit((HWND) wxGetInstance())) + if (!gaugeInit((HINSTANCE) wxGetInstance())) wxFatalError("Cannot initalize Gauge library"); wxGaugeMSWInitialised = TRUE; } @@ -540,13 +540,13 @@ void FAR PASCAL Draw3DLine(HDC hdc, WORD x, WORD y, WORD nLen, else return; /* select NULL_PEN for no borders */ - hOldPen = SelectObject(hdc, GetStockObject(NULL_PEN)); + hOldPen = (HPEN) SelectObject(hdc, GetStockObject(NULL_PEN)); /* select the appropriate color for the fill */ if (fDark) - hOldBrush = SelectObject(hdc, GetStockObject(GRAY_BRUSH)); + hOldBrush = (HBRUSH) SelectObject(hdc, GetStockObject(GRAY_BRUSH)); else - hOldBrush = SelectObject(hdc, GetStockObject(WHITE_BRUSH)); + hOldBrush = (HBRUSH) SelectObject(hdc, GetStockObject(WHITE_BRUSH)); /* finally, draw the dern thing */ Polygon(hdc, (LPPOINT)&Point, 4); @@ -857,7 +857,7 @@ static void PASCAL gaugePaint(HWND hwnd, HDC hdc) GetClientRect(hwnd, &rc1); /* draw a black border on the _outside_ */ - FrameRect(hdc, &rc1, GetStockObject(BLACK_BRUSH)); + FrameRect(hdc, &rc1, (HBRUSH) GetStockObject(BLACK_BRUSH)); /* we want to draw _just inside_ the black border */ InflateRect(&rc1, -1, -1); @@ -878,7 +878,7 @@ static void PASCAL gaugePaint(HWND hwnd, HDC hdc) InflateRect(&rc1, ~(pgauge->wWidth3D), ~(pgauge->wWidth3D)); /* draw a black border on the _inside_ */ - FrameRect(hdc, &rc1, GetStockObject(BLACK_BRUSH)); + FrameRect(hdc, &rc1, (HBRUSH) GetStockObject(BLACK_BRUSH)); /* we want to draw _just inside_ the black border */ InflateRect(&rc1, -1, -1); @@ -925,7 +925,7 @@ static void PASCAL gaugePaint(HWND hwnd, HDC hdc) } /* switch () */ /* select the correct font */ - hFont = SelectObject(hdc, pgauge->hFont); + hFont = (HFONT) SelectObject(hdc, pgauge->hFont); /* build up a string to blit out--ie the meaning of life: "42%" */ wsprintf(ach, "%3d%%", (WORD)((DWORD)iPos * 100 / iRange)); @@ -1148,7 +1148,7 @@ zyzgForceRepaint3D: case WM_SETFONT: /* if NULL hFont, use system font */ if (!(hFont = (HFONT)wParam)) - hFont = GetStockObject(SYSTEM_FONT); + hFont = (HFONT) GetStockObject(SYSTEM_FONT); pgauge->hFont = hFont; diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index afd8c76827..074548dcc7 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -539,7 +539,7 @@ void wxListBox::SetHorizontalExtent(const wxString& s) HDC dc = GetWindowDC(hwnd); HFONT oldFont = 0; if (GetFont() && GetFont()->GetResourceHandle()) - oldFont = ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle()); + oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle()); GetTextMetrics(dc, &lpTextMetric); SIZE extentXY; @@ -560,7 +560,7 @@ void wxListBox::SetHorizontalExtent(const wxString& s) HDC dc = GetWindowDC(hwnd); HFONT oldFont = 0; if (GetFont() && GetFont()->GetResourceHandle()) - oldFont = ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle()); + oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle()); GetTextMetrics(dc, &lpTextMetric); int i; diff --git a/src/msw/main.cpp b/src/msw/main.cpp index e4301f74dc..1cab1f628e 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -41,7 +41,7 @@ int PASCAL int APIENTRY #endif - WinMain(HANDLE hInstance, HANDLE hPrevInstance, LPSTR m_lpCmdLine, int nCmdShow ) + WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR m_lpCmdLine, int nCmdShow ) { return wxEntry((WXHINSTANCE) hInstance, (WXHINSTANCE) hPrevInstance, m_lpCmdLine, nCmdShow); } diff --git a/src/msw/makefile.b32 b/src/msw/makefile.b32 index c9f885f26a..7210398a80 100644 --- a/src/msw/makefile.b32 +++ b/src/msw/makefile.b32 @@ -560,7 +560,7 @@ $(CFG): makefile.b32 -Oxt -WE --I$(WXINC);$(BCCDIR)\include +-I$(WXINC);$(BCCDIR)\include;-I$(WXDIR)/src/png;-I$(WXDIR)/src/zlib -I$(WXDIR)\include\msw\gnuwin32 -L$(BCCDIR)\lib diff --git a/src/msw/makefile.nt b/src/msw/makefile.nt index bb8d50b168..6ea50a852e 100644 --- a/src/msw/makefile.nt +++ b/src/msw/makefile.nt @@ -71,6 +71,8 @@ GENERICOBJS= \ $(GENDIR)\tabg.obj \ $(GENDIR)\textdlgg.obj +# $(COMMDIR)\fileconf.obj \ + COMMONOBJS = \ $(COMMDIR)\cmndata.obj \ $(COMMDIR)\config.obj \ @@ -78,7 +80,6 @@ COMMONOBJS = \ $(COMMDIR)\dynarray.obj \ $(COMMDIR)\event.obj \ $(COMMDIR)\file.obj \ - $(COMMDIR)\fileconf.obj \ $(COMMDIR)\filefn.obj \ $(COMMDIR)\gdicmn.obj \ $(COMMDIR)\intl.obj \ diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 0e90215e9d..c156a76dc9 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -609,7 +609,7 @@ bool wxMDIParentFrame::MSWProcessMessage(WXMSG* msg) return TRUE; if (m_acceleratorTable != (WXHANDLE) NULL && - ::TranslateAccelerator((HWND) GetHWND(), (HANDLE) m_acceleratorTable, pMsg)) + ::TranslateAccelerator((HWND) GetHWND(), (HACCEL) m_acceleratorTable, pMsg)) return TRUE; if (pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN) @@ -818,7 +818,7 @@ void wxMDIChildFrame::SetMenuBar(wxMenuBar *menu_bar) wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent(); parent->m_parentFrameActive = FALSE; - HMENU subMenu = GetSubMenu((HWND) parent->GetWindowMenu(), 0); + HMENU subMenu = GetSubMenu((HMENU) parent->GetWindowMenu(), 0); // Try to insert Window menu in front of Help, otherwise append it. int N = GetMenuItemCount(menu); @@ -960,7 +960,7 @@ bool wxMDIChildFrame::MSWProcessMessage(WXMSG *msg) { wxFrame *parent = (wxFrame *)GetParent(); HWND parent_hwnd = (HWND) parent->GetHWND(); - return (::TranslateAccelerator(parent_hwnd, (HANDLE) m_acceleratorTable, pMsg) != 0); + return (::TranslateAccelerator(parent_hwnd, (HACCEL) m_acceleratorTable, pMsg) != 0); } return FALSE; } diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index fe52d2438b..c22d980311 100644 --- a/src/msw/metafile.cpp +++ b/src/msw/metafile.cpp @@ -62,7 +62,7 @@ wxMetaFile::wxMetaFile(const wxString& file) wxMetaFile::~wxMetaFile(void) { if (m_metaFile) - { DeleteMetaFile((HANDLE) m_metaFile); m_metaFile = 0; } + { DeleteMetaFile((HMETAFILE) m_metaFile); m_metaFile = 0; } } bool wxMetaFile::SetClipboard(int width, int height) @@ -83,7 +83,7 @@ bool wxMetaFile::Play(wxDC *dc) dc->BeginDrawing(); if (dc->GetHDC() && m_metaFile) - PlayMetaFile((HDC) dc->GetHDC(), (HANDLE) m_metaFile); + PlayMetaFile((HDC) dc->GetHDC(), (HMETAFILE) m_metaFile); dc->EndDrawing(); diff --git a/src/msw/minifram.cpp b/src/msw/minifram.cpp index ca7b86bea6..b6e22bb12d 100644 --- a/src/msw/minifram.cpp +++ b/src/msw/minifram.cpp @@ -841,13 +841,13 @@ BOOL PASCAL DrawCaption( HDC hDC, HWND hWnd, LPRECT lprc, DRAWFASTRECT( hDC, &rc ) ; hbrCaption = CreateSolidBrush( rgbCaptionBG ) ; - hbrCaption = SelectObject( hDC, hbrCaption ) ; - SelectObject( hDC, GetStockObject( NULL_PEN ) ) ; + hbrCaption = (HBRUSH) SelectObject( hDC, hbrCaption ) ; + SelectObject( hDC, (HPEN) GetStockObject( NULL_PEN ) ) ; if (fVert) Rectangle( hDC, rcCap.left, rcCap.top, rcCap.right, rcCap.bottom + 1 ) ; else Rectangle( hDC, rcCap.left, rcCap.top, rcCap.right+1, rcCap.bottom ) ; - hbrCaption = SelectObject( hDC, hbrCaption ) ; + hbrCaption = (HBRUSH) SelectObject( hDC, hbrCaption ) ; DeleteObject( hbrCaption ) ; @@ -901,7 +901,7 @@ BOOL PASCAL DrawCaption( HDC hDC, HWND hWnd, LPRECT lprc, lf.lfOrientation = 900 ; hFont = CreateFontIndirect( &lf ) ; - hFont = SelectObject( hDC, hFont ) ; + hFont = (HFONT) SelectObject( hDC, hFont ) ; GetTextExtentPoint( hDC, lpsz, ui, &Size ) ; cx = rcCap.bottom - ((rcCap.bottom - rcCap.top - Size.cx) / 2) ; @@ -920,7 +920,7 @@ BOOL PASCAL DrawCaption( HDC hDC, HWND hWnd, LPRECT lprc, lpsz, ui, NULL ) ; } - hFont = SelectObject( hDC, hFont ) ; + hFont = (HFONT) SelectObject( hDC, hFont ) ; DeleteObject( hFont ) ; } else @@ -931,7 +931,7 @@ BOOL PASCAL DrawCaption( HDC hDC, HWND hWnd, LPRECT lprc, lf.lfPitchAndFamily = FF_SWISS ; hFont = CreateFontIndirect( &lf ) ; - hFont = SelectObject( hDC, hFont ) ; + hFont = (HFONT) SelectObject( hDC, hFont ) ; GetTextExtentPoint( hDC, lpsz, ui, &Size ) ; cx = rcCap.left + ((rcCap.right - rcCap.left - Size.cx) / 2) ; @@ -945,7 +945,7 @@ BOOL PASCAL DrawCaption( HDC hDC, HWND hWnd, LPRECT lprc, ETO_CLIPPED, &rcCap, lpsz, ui, NULL ) ; - hFont = SelectObject( hDC, hFont ) ; + hFont = (HFONT) SelectObject( hDC, hFont ) ; DeleteObject( hFont ) ; } diff --git a/src/msw/ownerdrw.cpp b/src/msw/ownerdrw.cpp index 84249668ad..50d45ce921 100644 --- a/src/msw/ownerdrw.cpp +++ b/src/msw/ownerdrw.cpp @@ -128,7 +128,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODSt #ifdef O_DRAW_NATIVE_API int nPrevMode = SetBkMode(hdc, TRANSPARENT); HBRUSH hbr = CreateSolidBrush(colBack), - hPrevBrush = SelectObject(hdc, hbr); + hPrevBrush = (HBRUSH) SelectObject(hdc, hbr); RECT rectAll = { rc.GetLeft(), rc.GetTop(), rc.GetRight(), rc.GetBottom() }; FillRect(hdc, &rectAll, hbr); @@ -143,7 +143,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODSt hfont = (HFONT)::GetStockObject(SYSTEM_FONT); } - HFONT hPrevFont = ::SelectObject(hdc, hfont); + HFONT hPrevFont = (HFONT) ::SelectObject(hdc, hfont); DrawState(hdc, NULL, NULL, (LPARAM)(const char *)m_strName, m_strName.Length(), x, rc.y, rc.GetWidth(), rc.GetHeight(), diff --git a/src/msw/pnghand.cpp b/src/msw/pnghand.cpp index c6fad8a66b..2fb019783b 100644 --- a/src/msw/pnghand.cpp +++ b/src/msw/pnghand.cpp @@ -271,7 +271,7 @@ bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap) HDC dc2 = GetDC(NULL); HBITMAP tmpBitmap = ::CreateCompatibleBitmap(dc2, GetWidth(), GetHeight()); ReleaseDC(NULL, dc2); - HBITMAP oldBitmap = ::SelectObject(dc, tmpBitmap); + HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, tmpBitmap); if ( Palette ) { @@ -342,7 +342,7 @@ wxMask *wxPNGReader::CreateMask(void) HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL); HDC dc = ::CreateCompatibleDC(NULL); - HBITMAP oldBitmap = ::SelectObject(dc, hBitmap); + HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, hBitmap); int bgIndex = GetBGIndex(); diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index a124a83685..ccfdcc997a 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -171,7 +171,7 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt wxWindow *win = CreateAbortWindow(parent, printout); wxYield(); - ::SetAbortProc((HDC) dc->GetHDC(), (FARPROC) lpAbortProc); + ::SetAbortProc((HDC) dc->GetHDC(), (int (_stdcall *)(HDC, int)) lpAbortProc); if (!win) { diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index 5c0483014d..14b4f94c9b 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -154,7 +154,7 @@ bool wxStaticBitmap::MSWOnDraw(WXDRAWITEMSTRUCT *item) HDC hDC = lpDIS->hDC; HDC memDC = ::CreateCompatibleDC(hDC); - HBITMAP old = ::SelectObject(memDC, (HBITMAP) bitmap->GetHBITMAP()); + HBITMAP old = (HBITMAP) ::SelectObject(memDC, (HBITMAP) bitmap->GetHBITMAP()); if (!old) return FALSE; diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 63a64b9f57..54a2027c42 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -188,7 +188,7 @@ bool wxToolBar95::CreateTools(void) // Now blit all the tools onto this bitmap HDC memoryDC = ::CreateCompatibleDC(NULL); - HBITMAP oldBitmap = ::SelectObject(memoryDC, (HBITMAP) m_hBitmap); + HBITMAP oldBitmap = (HBITMAP) ::SelectObject(memoryDC, (HBITMAP) m_hBitmap); HDC memoryDC2 = ::CreateCompatibleDC(NULL); int x = 0; @@ -201,7 +201,7 @@ bool wxToolBar95::CreateTools(void) { // wxPalette *palette = tool->m_bitmap1->GetPalette(); - HBITMAP oldBitmap2 = ::SelectObject(memoryDC2, (HBITMAP) tool->m_bitmap1.GetHBITMAP()); + HBITMAP oldBitmap2 = (HBITMAP) ::SelectObject(memoryDC2, (HBITMAP) tool->m_bitmap1.GetHBITMAP()); /* int bltResult = */ BitBlt(memoryDC, x, 0, (int) m_defaultWidth, (int) m_defaultHeight, memoryDC2, 0, 0, SRCCOPY); @@ -506,7 +506,7 @@ void wxMapBitmap(HBITMAP hBitmap, int width, int height) if (hdcMem) { - hbmOld = SelectObject(hdcMem, hBitmap); + hbmOld = (HBITMAP) SelectObject(hdcMem, hBitmap); int i, j, k; for ( i = 0; i < width; i++) diff --git a/src/msw/tbarmsw.cpp b/src/msw/tbarmsw.cpp index 7e7402fa1a..697df07d12 100644 --- a/src/msw/tbarmsw.cpp +++ b/src/msw/tbarmsw.cpp @@ -439,7 +439,7 @@ void wxToolBarMSW::CreateMask(WXHDC hdc, int xoffset, int yoffset, int dx, int d // krj - create a new bitmap and copy the image from hdc. //HBITMAP bitmapOld = SelectObject(hdcGlyphs, hBitmap); HBITMAP hBitmap = CreateCompatibleBitmap((HDC) hdc, dx, dy); - HBITMAP bitmapOld = SelectObject(hdcGlyphs, hBitmap); + HBITMAP bitmapOld = (HBITMAP) SelectObject(hdcGlyphs, hBitmap); BitBlt(hdcGlyphs, 0,0, dx, dy, (HDC) hdc, 0, 0, SRCCOPY); // initalize whole area with 1's @@ -528,11 +528,11 @@ void wxToolBarMSW::DrawButton(WXHDC hdc, int x, int y, int dx, int dy, wxToolBar #if !defined(__WIN32__) && !defined(__WIN386__) HBITMAP bitmapOld; if (tool->m_bitmap2.Ok()) - bitmapOld = SelectObject(hdcGlyphs, (HBITMAP) tool->m_bitmap2.GetHBITMAP()); + bitmapOld = (HBITMAP) SelectObject(hdcGlyphs, (HBITMAP) tool->m_bitmap2.GetHBITMAP()); else - bitmapOld = SelectObject(hdcGlyphs, (HBITMAP) tool->m_bitmap1.GetHBITMAP()); + bitmapOld = (HBITMAP) SelectObject(hdcGlyphs, (HBITMAP) tool->m_bitmap1.GetHBITMAP()); #else - HBITMAP bitmapOld = SelectObject(hdcGlyphs, (HBITMAP) tool->m_bitmap1.GetHBITMAP()); + HBITMAP bitmapOld = (HBITMAP) SelectObject(hdcGlyphs, (HBITMAP) tool->m_bitmap1.GetHBITMAP()); #endif // calculate offset of face from (x,y). y is always from the top, @@ -564,7 +564,7 @@ void wxToolBarMSW::DrawButton(WXHDC hdc, int x, int y, int dx, int dy, wxToolBar if (!(state & wxTBSTATE_INDETERMINATE)) { hbr = CreateSolidBrush(m_rgbHilight); if (hbr) { - hbrOld = SelectObject((HDC) hdc, hbr); + hbrOld = (HBRUSH) SelectObject((HDC) hdc, hbr); if (hbrOld) { // draw hilight color where we have 0's in the mask BitBlt((HDC) hdc, x + 1, y + 1, dxFace, dyFace, (HDC) m_hdcMono, 0, 0, 0x00B8074A); @@ -577,7 +577,7 @@ void wxToolBarMSW::DrawButton(WXHDC hdc, int x, int y, int dx, int dy, wxToolBar // gray out glyph hbr = CreateSolidBrush(m_rgbShadow); if (hbr) { - hbrOld = SelectObject((HDC) hdc, hbr); + hbrOld = (HBRUSH) SelectObject((HDC) hdc, hbr); if (hbrOld) { // draw the shadow color where we have 0's in the mask BitBlt((HDC) hdc, x, y, dxFace, dyFace, (HDC) m_hdcMono, 0, 0, 0x00B8074A); @@ -593,7 +593,7 @@ void wxToolBarMSW::DrawButton(WXHDC hdc, int x, int y, int dx, int dy, wxToolBar if (state & (wxTBSTATE_CHECKED | wxTBSTATE_INDETERMINATE)) { - hbrOld = SelectObject((HDC) hdc, (HBRUSH) m_hbrDither); + hbrOld = (HBRUSH) SelectObject((HDC) hdc, (HBRUSH) m_hbrDither); if (hbrOld) { if (!bMaskCreated) @@ -817,7 +817,7 @@ WXHBITMAP wxToolBarMSW::CreateMappedBitmap(WXHINSTANCE WXUNUSED(hInstance), void // hbm = CreateDiscardableBitmap(hdc, i, hgt); hbm = CreateCompatibleBitmap(hdc, i, hgt); if (hbm) { - hbmOld = SelectObject(hdcMem, hbm); + hbmOld = (HBITMAP) SelectObject(hdcMem, hbm); // set the main image StretchDIBits(hdcMem, 0, 0, wid, hgt, 0, 0, wid, hgt, lpBits, diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index a18f26bf01..8e575ea3ad 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -171,7 +171,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, HWND edit = CreateWindowEx(exStyle, windowClass, NULL, msStyle, 0, 0, 0, 0, (HWND) ((wxWindow*)parent)->GetHWND(), (HMENU)m_windowId, - m_globalHandle ? (HANDLE) m_globalHandle : wxGetInstance(), NULL); + m_globalHandle ? (HINSTANCE) m_globalHandle : wxGetInstance(), NULL); #if CTL3D if ( want3D ) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 5d7a02170d..ce22737cb5 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -807,7 +807,7 @@ void wxWindow::GetTextExtent(const wxString& string, int *x, int *y, if (fontToUse && fontToUse->Ok()) { if ((fnt=(HFONT) fontToUse->GetResourceHandle())) - was = SelectObject(dc,fnt) ; + was = (HFONT) SelectObject(dc,fnt) ; } SIZE sizeRect; @@ -1686,7 +1686,7 @@ void wxWindow::MSWOnDropFiles(WXWPARAM wParam) wxDebugMsg("wxWindow::MSWOnDropFiles %d\n", m_hWnd); #endif - HANDLE hFilesInfo = (HANDLE)wParam; + HDROP hFilesInfo = (HDROP) wParam; POINT dropPoint; DragQueryPoint(hFilesInfo, (LPPOINT) &dropPoint); @@ -2647,7 +2647,7 @@ void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font) // the_font->UseResource(); // the_font->RealizeResource(); if ((fnt=(HFONT) the_font->GetResourceHandle())) - was = SelectObject(dc,fnt) ; + was = (HFONT) SelectObject(dc,fnt) ; } GetTextMetrics(dc, &tm); if (the_font && fnt && was) diff --git a/src/ntwxwin.mak b/src/ntwxwin.mak index ec854fd8b2..22e9f90ea5 100644 --- a/src/ntwxwin.mak +++ b/src/ntwxwin.mak @@ -141,9 +141,9 @@ PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH) /Fd$(WXDIR)\lib\wx.pdb MAKEPRECOMP=/YcWX/WXPREC.H !endif -CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(OPT) $(EXTRADLLFLAGS) /MD /GX /D__WXDEBUG__ /DWXDEBUG=1 +CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(OPT) $(EXTRADLLFLAGS) /MD /GX /D__WXDEBUG__ /DWXDEBUG=1 /DSTRICT # If you don't include wxprec.h, use CPPFLAGS2 -CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) /MD /GX /D__WXDEBUG__ /DWXDEBUG=1 +CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ /DDEBUG=1 $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) /MD /GX /D__WXDEBUG__ /DWXDEBUG=1 /DSTRICT LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -entry:WinMainCRTStartup DUMMY=dummy