Added STRICT corrections.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 1998-07-17 09:32:24 +00:00
parent e99c304810
commit c4e7c2aa58
27 changed files with 73 additions and 69 deletions

View File

@ -40,7 +40,8 @@ wxFont WXDLLEXPORT wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNe
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#define CASTWNDPROC (long unsigned) #define CASTWNDPROC (long unsigned)
#else #else
#define CASTWNDPROC typedef long (_stdcall * WndProcCast) (HWND, unsigned int, unsigned int, long);
#define CASTWNDPROC (WndProcCast)
#endif #endif
#if !defined(APIENTRY) // NT defines APIENTRY, 3.x not #if !defined(APIENTRY) // NT defines APIENTRY, 3.x not

View File

@ -387,7 +387,7 @@ void wxPageSetupData::ConvertToNative(void)
pd->Flags |= PSD_SHOWHELP; pd->Flags |= PSD_SHOWHELP;
pd->lStructSize = sizeof( PAGESETUPDLG ); pd->lStructSize = sizeof( PAGESETUPDLG );
pd->hwndOwner=(HANDLE)NULL; pd->hwndOwner=(HWND)NULL;
pd->hDevNames=(HWND)NULL; pd->hDevNames=(HWND)NULL;
pd->hInstance=(HINSTANCE)NULL; pd->hInstance=(HINSTANCE)NULL;

View File

@ -26,10 +26,12 @@
#include "wx/datstrm.h" #include "wx/datstrm.h"
/*
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxDataInputStream, wxFilterInputStream) IMPLEMENT_CLASS(wxDataInputStream, wxFilterInputStream)
IMPLEMENT_CLASS(wxDataOutputStream, wxFilterOutputStream) IMPLEMENT_CLASS(wxDataOutputStream, wxFilterOutputStream)
#endif #endif
*/
wxDataInputStream::wxDataInputStream(wxInputStream& s) wxDataInputStream::wxDataInputStream(wxInputStream& s)
: wxFilterInputStream(s) : wxFilterInputStream(s)

View File

@ -59,7 +59,7 @@ extern wxList wxPendingDelete;
extern void wxSetKeyboardHook(bool doIt); extern void wxSetKeyboardHook(bool doIt);
extern wxCursor *g_globalCursor; extern wxCursor *g_globalCursor;
HANDLE wxhInstance = 0; HINSTANCE wxhInstance = 0;
static MSG s_currentMsg; static MSG s_currentMsg;
wxApp *wxTheApp = NULL; wxApp *wxTheApp = NULL;
@ -94,9 +94,9 @@ long wxApp::sm_lastMessageTime = 0;
static HINSTANCE gs_hRichEdit = NULL; static HINSTANCE gs_hRichEdit = NULL;
#endif #endif
bool wxApp::Initialize(WXHANDLE instance) bool wxApp::Initialize(WXHINSTANCE instance)
{ {
HANDLE hInstance = (HANDLE)instance; HINSTANCE hInstance = (HINSTANCE) instance;
CommonInit(); CommonInit();
@ -248,7 +248,7 @@ bool wxApp::RegisterWindowClasses()
wndclass2.hIcon = NULL; wndclass2.hIcon = NULL;
wndclass2.hCursor = NULL; wndclass2.hCursor = NULL;
// wndclass2.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1) ; // wndclass2.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1) ;
wndclass2.hbrBackground = GetStockObject( LTGRAY_BRUSH ); wndclass2.hbrBackground = (HBRUSH) GetStockObject( LTGRAY_BRUSH );
wndclass2.lpszMenuName = NULL; wndclass2.lpszMenuName = NULL;
wndclass2.lpszClassName = wxPanelClassName; wndclass2.lpszClassName = wxPanelClassName;
if (!RegisterClass( &wndclass2 )) if (!RegisterClass( &wndclass2 ))

View File

@ -130,7 +130,7 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
HDC hDC = lpDIS->hDC; HDC hDC = lpDIS->hDC;
HDC memDC = ::CreateCompatibleDC(hDC); HDC memDC = ::CreateCompatibleDC(hDC);
HBITMAP old = ::SelectObject(memDC, (HBITMAP) bitmap->GetHBITMAP()); HBITMAP old = (HBITMAP) ::SelectObject(memDC, (HBITMAP) bitmap->GetHBITMAP());
if (!old) if (!old)
return FALSE; return FALSE;
@ -194,8 +194,8 @@ void wxBitmapButton::DrawFace( WXHDC dc, int left, int top, int right, int botto
ms_color = GetSysColor(COLOR_BTNFACE) ; ms_color = GetSysColor(COLOR_BTNFACE) ;
brushFace = CreateSolidBrush(ms_color) ; brushFace = CreateSolidBrush(ms_color) ;
oldp = SelectObject( (HDC) dc, GetStockObject( NULL_PEN ) ) ; oldp = (HPEN) SelectObject( (HDC) dc, GetStockObject( NULL_PEN ) ) ;
oldb = SelectObject( (HDC) dc, brushFace ) ; oldb = (HBRUSH) SelectObject( (HDC) dc, brushFace ) ;
Rectangle( (HDC) dc, left, top, right, bottom ) ; Rectangle( (HDC) dc, left, top, right, bottom ) ;
SelectObject( (HDC) dc, penBorder) ; SelectObject( (HDC) dc, penBorder) ;
MoveToEx((HDC) dc,left+1,top,NULL);LineTo((HDC) dc,right-1,top); 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; extern HBRUSH wxDisableButtonBrush;
void wxBitmapButton::DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg ) 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 ) if ( with_marg )
::PatBlt( (HDC) dc, left + m_marginX, top + m_marginY, ::PatBlt( (HDC) dc, left + m_marginX, top + m_marginY,

View File

@ -92,7 +92,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height)
HDC hdcMem = CreateCompatibleDC(NULL); HDC hdcMem = CreateCompatibleDC(NULL);
HDC hdcSrc = 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, HBITMAP hBitmap = CreateCompatibleBitmap(hdcSrc,
wxBM->GetWidth(), wxBM->GetHeight()); wxBM->GetWidth(), wxBM->GetHeight());
if (!hBitmap) if (!hBitmap)
@ -102,7 +102,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height)
DeleteDC(hdcSrc); DeleteDC(hdcSrc);
return FALSE; return FALSE;
} }
HBITMAP old1 = SelectObject(hdcMem, hBitmap); HBITMAP old1 = (HBITMAP) SelectObject(hdcMem, hBitmap);
BitBlt(hdcMem, 0, 0, wxBM->GetWidth(), wxBM->GetHeight(), BitBlt(hdcMem, 0, 0, wxBM->GetWidth(), wxBM->GetHeight(),
hdcSrc, 0, 0, SRCCOPY); hdcSrc, 0, 0, SRCCOPY);
@ -145,7 +145,7 @@ bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height)
mf->mm = wxMF->GetWindowsMappingMode(); mf->mm = wxMF->GetWindowsMappingMode();
mf->xExt = width; mf->xExt = width;
mf->yExt = height; mf->yExt = height;
mf->hMF = (HANDLE) wxMF->GetHMETAFILE(); mf->hMF = (HMETAFILE) wxMF->GetHMETAFILE();
GlobalUnlock(data); GlobalUnlock(data);
wxMF->SetHMETAFILE((WXHANDLE) NULL); wxMF->SetHMETAFILE((WXHANDLE) NULL);
@ -206,14 +206,14 @@ wxObject *wxGetClipboardData(int dataFormat, long *len)
case wxCF_BITMAP: case wxCF_BITMAP:
{ {
BITMAP bm; BITMAP bm;
HBITMAP hBitmap = GetClipboardData(CF_BITMAP); HBITMAP hBitmap = (HBITMAP) GetClipboardData(CF_BITMAP);
if (!hBitmap) if (!hBitmap)
return NULL; return NULL;
HDC hdcMem = CreateCompatibleDC(NULL); HDC hdcMem = CreateCompatibleDC(NULL);
HDC hdcSrc = CreateCompatibleDC(NULL); HDC hdcSrc = CreateCompatibleDC(NULL);
HBITMAP old = ::SelectObject(hdcSrc, hBitmap); HBITMAP old = (HBITMAP) ::SelectObject(hdcSrc, hBitmap);
GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm); GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm);
HBITMAP hNewBitmap = CreateBitmapIndirect(&bm); HBITMAP hNewBitmap = CreateBitmapIndirect(&bm);
@ -226,7 +226,7 @@ wxObject *wxGetClipboardData(int dataFormat, long *len)
return NULL; return NULL;
} }
HBITMAP old1 = SelectObject(hdcMem, hNewBitmap); HBITMAP old1 = (HBITMAP) SelectObject(hdcMem, hNewBitmap);
BitBlt(hdcMem, 0, 0, bm.bmWidth, bm.bmHeight, BitBlt(hdcMem, 0, 0, bm.bmWidth, bm.bmHeight,
hdcSrc, 0, 0, SRCCOPY); hdcSrc, 0, 0, SRCCOPY);

View File

@ -772,7 +772,7 @@ HCURSOR MakeCursorFromBitmap(HINSTANCE hInst, HBITMAP hBitmap, POINT *pPoint)
hAndBmp = CreateCompatibleBitmap(hDCMono, 32, 32); hAndBmp = CreateCompatibleBitmap(hDCMono, 32, 32);
hXorBmp = CreateCompatibleBitmap(hDCMono, 32, 32); hXorBmp = CreateCompatibleBitmap(hDCMono, 32, 32);
hBmpOld = SelectObject(hDCColor, hBitmap); hBmpOld = (HBITMAP) SelectObject(hDCColor, hBitmap);
SelectObject(hDCMono, hAndBmp); SelectObject(hDCMono, hAndBmp);
SetBkColor(hDCColor, RGB(191, 191, 191)); SetBkColor(hDCColor, RGB(191, 191, 191));
@ -849,7 +849,7 @@ HICON MakeIconFromBitmap(HINSTANCE hInst, HBITMAP hBitmap)
hAndBmp = CreateCompatibleBitmap(hDCMono, 32, 32); hAndBmp = CreateCompatibleBitmap(hDCMono, 32, 32);
hXorBmp = CreateCompatibleBitmap(hDCMono, 32, 32); hXorBmp = CreateCompatibleBitmap(hDCMono, 32, 32);
hBmpOld = SelectObject(hDCColor, hBitmap); hBmpOld = (HBITMAP) SelectObject(hDCColor, hBitmap);
SelectObject(hDCMono, hAndBmp); SelectObject(hDCMono, hAndBmp);
SetBkColor(hDCColor, RGB(191, 191, 191)); SetBkColor(hDCColor, RGB(191, 191, 191));

View File

@ -94,7 +94,7 @@ void wxMemoryDC::SelectObject(const wxBitmap& bitmap)
#if WXDEBUG > 1 #if WXDEBUG > 1
wxDebugMsg("wxMemoryDC::SelectObject: Selecting HBITMAP %X\n", m_selectedBitmap.GetHBITMAP()); wxDebugMsg("wxMemoryDC::SelectObject: Selecting HBITMAP %X\n", m_selectedBitmap.GetHBITMAP());
#endif #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) if (bm == ERROR)
{ {

View File

@ -682,7 +682,7 @@ HPALETTE MakeDIBPalette(LPBITMAPINFOHEADER lpInfo)
** some good color choices. ** some good color choices.
*/ */
else else
return(GetStockObject(DEFAULT_PALETTE)); return((HPALETTE) GetStockObject(DEFAULT_PALETTE));
} }
bool wxLoadIntoBitmap(char *filename, wxBitmap *bitmap, wxColourMap **pal) bool wxLoadIntoBitmap(char *filename, wxBitmap *bitmap, wxColourMap **pal)

View File

@ -739,7 +739,7 @@ void wxFrame::MSWOnMenuHighlight(WXWORD nItem, WXWORD nFlags, WXHMENU hSysMenu)
bool wxFrame::MSWProcessMessage(WXMSG* pMsg) bool wxFrame::MSWProcessMessage(WXMSG* pMsg)
{ {
if (m_acceleratorTable != 0 && if (m_acceleratorTable != 0 &&
::TranslateAccelerator((HWND) GetHWND(), (HANDLE) m_acceleratorTable, (MSG *)pMsg)) ::TranslateAccelerator((HWND) GetHWND(), (HACCEL) m_acceleratorTable, (MSG *)pMsg))
return TRUE; return TRUE;
return FALSE; return FALSE;

View File

@ -75,7 +75,7 @@ bool wxGaugeMSW::Create(wxWindow *parent, wxWindowID id,
if ( !wxGaugeMSWInitialised ) if ( !wxGaugeMSWInitialised )
{ {
if (!gaugeInit((HWND) wxGetInstance())) if (!gaugeInit((HINSTANCE) wxGetInstance()))
wxFatalError("Cannot initalize Gauge library"); wxFatalError("Cannot initalize Gauge library");
wxGaugeMSWInitialised = TRUE; wxGaugeMSWInitialised = TRUE;
} }
@ -540,13 +540,13 @@ void FAR PASCAL Draw3DLine(HDC hdc, WORD x, WORD y, WORD nLen,
else return; else return;
/* select NULL_PEN for no borders */ /* 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 */ /* select the appropriate color for the fill */
if (fDark) if (fDark)
hOldBrush = SelectObject(hdc, GetStockObject(GRAY_BRUSH)); hOldBrush = (HBRUSH) SelectObject(hdc, GetStockObject(GRAY_BRUSH));
else else
hOldBrush = SelectObject(hdc, GetStockObject(WHITE_BRUSH)); hOldBrush = (HBRUSH) SelectObject(hdc, GetStockObject(WHITE_BRUSH));
/* finally, draw the dern thing */ /* finally, draw the dern thing */
Polygon(hdc, (LPPOINT)&Point, 4); Polygon(hdc, (LPPOINT)&Point, 4);
@ -857,7 +857,7 @@ static void PASCAL gaugePaint(HWND hwnd, HDC hdc)
GetClientRect(hwnd, &rc1); GetClientRect(hwnd, &rc1);
/* draw a black border on the _outside_ */ /* 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 */ /* we want to draw _just inside_ the black border */
InflateRect(&rc1, -1, -1); InflateRect(&rc1, -1, -1);
@ -878,7 +878,7 @@ static void PASCAL gaugePaint(HWND hwnd, HDC hdc)
InflateRect(&rc1, ~(pgauge->wWidth3D), ~(pgauge->wWidth3D)); InflateRect(&rc1, ~(pgauge->wWidth3D), ~(pgauge->wWidth3D));
/* draw a black border on the _inside_ */ /* 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 */ /* we want to draw _just inside_ the black border */
InflateRect(&rc1, -1, -1); InflateRect(&rc1, -1, -1);
@ -925,7 +925,7 @@ static void PASCAL gaugePaint(HWND hwnd, HDC hdc)
} /* switch () */ } /* switch () */
/* select the correct font */ /* 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%" */ /* build up a string to blit out--ie the meaning of life: "42%" */
wsprintf(ach, "%3d%%", (WORD)((DWORD)iPos * 100 / iRange)); wsprintf(ach, "%3d%%", (WORD)((DWORD)iPos * 100 / iRange));
@ -1148,7 +1148,7 @@ zyzgForceRepaint3D:
case WM_SETFONT: case WM_SETFONT:
/* if NULL hFont, use system font */ /* if NULL hFont, use system font */
if (!(hFont = (HFONT)wParam)) if (!(hFont = (HFONT)wParam))
hFont = GetStockObject(SYSTEM_FONT); hFont = (HFONT) GetStockObject(SYSTEM_FONT);
pgauge->hFont = hFont; pgauge->hFont = hFont;

View File

@ -539,7 +539,7 @@ void wxListBox::SetHorizontalExtent(const wxString& s)
HDC dc = GetWindowDC(hwnd); HDC dc = GetWindowDC(hwnd);
HFONT oldFont = 0; HFONT oldFont = 0;
if (GetFont() && GetFont()->GetResourceHandle()) if (GetFont() && GetFont()->GetResourceHandle())
oldFont = ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle()); oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle());
GetTextMetrics(dc, &lpTextMetric); GetTextMetrics(dc, &lpTextMetric);
SIZE extentXY; SIZE extentXY;
@ -560,7 +560,7 @@ void wxListBox::SetHorizontalExtent(const wxString& s)
HDC dc = GetWindowDC(hwnd); HDC dc = GetWindowDC(hwnd);
HFONT oldFont = 0; HFONT oldFont = 0;
if (GetFont() && GetFont()->GetResourceHandle()) if (GetFont() && GetFont()->GetResourceHandle())
oldFont = ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle()); oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle());
GetTextMetrics(dc, &lpTextMetric); GetTextMetrics(dc, &lpTextMetric);
int i; int i;

View File

@ -41,7 +41,7 @@ int PASCAL
int APIENTRY int APIENTRY
#endif #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); return wxEntry((WXHINSTANCE) hInstance, (WXHINSTANCE) hPrevInstance, m_lpCmdLine, nCmdShow);
} }

View File

@ -560,7 +560,7 @@ $(CFG): makefile.b32
-Oxt -Oxt
-WE -WE
-I$(WXINC);$(BCCDIR)\include -I$(WXINC);$(BCCDIR)\include;-I$(WXDIR)/src/png;-I$(WXDIR)/src/zlib
-I$(WXDIR)\include\msw\gnuwin32 -I$(WXDIR)\include\msw\gnuwin32
-L$(BCCDIR)\lib -L$(BCCDIR)\lib

View File

@ -71,6 +71,8 @@ GENERICOBJS= \
$(GENDIR)\tabg.obj \ $(GENDIR)\tabg.obj \
$(GENDIR)\textdlgg.obj $(GENDIR)\textdlgg.obj
# $(COMMDIR)\fileconf.obj \
COMMONOBJS = \ COMMONOBJS = \
$(COMMDIR)\cmndata.obj \ $(COMMDIR)\cmndata.obj \
$(COMMDIR)\config.obj \ $(COMMDIR)\config.obj \
@ -78,7 +80,6 @@ COMMONOBJS = \
$(COMMDIR)\dynarray.obj \ $(COMMDIR)\dynarray.obj \
$(COMMDIR)\event.obj \ $(COMMDIR)\event.obj \
$(COMMDIR)\file.obj \ $(COMMDIR)\file.obj \
$(COMMDIR)\fileconf.obj \
$(COMMDIR)\filefn.obj \ $(COMMDIR)\filefn.obj \
$(COMMDIR)\gdicmn.obj \ $(COMMDIR)\gdicmn.obj \
$(COMMDIR)\intl.obj \ $(COMMDIR)\intl.obj \

View File

@ -609,7 +609,7 @@ bool wxMDIParentFrame::MSWProcessMessage(WXMSG* msg)
return TRUE; return TRUE;
if (m_acceleratorTable != (WXHANDLE) NULL && if (m_acceleratorTable != (WXHANDLE) NULL &&
::TranslateAccelerator((HWND) GetHWND(), (HANDLE) m_acceleratorTable, pMsg)) ::TranslateAccelerator((HWND) GetHWND(), (HACCEL) m_acceleratorTable, pMsg))
return TRUE; return TRUE;
if (pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN) if (pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN)
@ -818,7 +818,7 @@ void wxMDIChildFrame::SetMenuBar(wxMenuBar *menu_bar)
wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent(); wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
parent->m_parentFrameActive = FALSE; 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. // Try to insert Window menu in front of Help, otherwise append it.
int N = GetMenuItemCount(menu); int N = GetMenuItemCount(menu);
@ -960,7 +960,7 @@ bool wxMDIChildFrame::MSWProcessMessage(WXMSG *msg)
{ {
wxFrame *parent = (wxFrame *)GetParent(); wxFrame *parent = (wxFrame *)GetParent();
HWND parent_hwnd = (HWND) parent->GetHWND(); 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; return FALSE;
} }

View File

@ -62,7 +62,7 @@ wxMetaFile::wxMetaFile(const wxString& file)
wxMetaFile::~wxMetaFile(void) wxMetaFile::~wxMetaFile(void)
{ {
if (m_metaFile) if (m_metaFile)
{ DeleteMetaFile((HANDLE) m_metaFile); m_metaFile = 0; } { DeleteMetaFile((HMETAFILE) m_metaFile); m_metaFile = 0; }
} }
bool wxMetaFile::SetClipboard(int width, int height) bool wxMetaFile::SetClipboard(int width, int height)
@ -83,7 +83,7 @@ bool wxMetaFile::Play(wxDC *dc)
dc->BeginDrawing(); dc->BeginDrawing();
if (dc->GetHDC() && m_metaFile) if (dc->GetHDC() && m_metaFile)
PlayMetaFile((HDC) dc->GetHDC(), (HANDLE) m_metaFile); PlayMetaFile((HDC) dc->GetHDC(), (HMETAFILE) m_metaFile);
dc->EndDrawing(); dc->EndDrawing();

View File

@ -841,13 +841,13 @@ BOOL PASCAL DrawCaption( HDC hDC, HWND hWnd, LPRECT lprc,
DRAWFASTRECT( hDC, &rc ) ; DRAWFASTRECT( hDC, &rc ) ;
hbrCaption = CreateSolidBrush( rgbCaptionBG ) ; hbrCaption = CreateSolidBrush( rgbCaptionBG ) ;
hbrCaption = SelectObject( hDC, hbrCaption ) ; hbrCaption = (HBRUSH) SelectObject( hDC, hbrCaption ) ;
SelectObject( hDC, GetStockObject( NULL_PEN ) ) ; SelectObject( hDC, (HPEN) GetStockObject( NULL_PEN ) ) ;
if (fVert) if (fVert)
Rectangle( hDC, rcCap.left, rcCap.top, rcCap.right, rcCap.bottom + 1 ) ; Rectangle( hDC, rcCap.left, rcCap.top, rcCap.right, rcCap.bottom + 1 ) ;
else else
Rectangle( hDC, rcCap.left, rcCap.top, rcCap.right+1, rcCap.bottom ) ; Rectangle( hDC, rcCap.left, rcCap.top, rcCap.right+1, rcCap.bottom ) ;
hbrCaption = SelectObject( hDC, hbrCaption ) ; hbrCaption = (HBRUSH) SelectObject( hDC, hbrCaption ) ;
DeleteObject( hbrCaption ) ; DeleteObject( hbrCaption ) ;
@ -901,7 +901,7 @@ BOOL PASCAL DrawCaption( HDC hDC, HWND hWnd, LPRECT lprc,
lf.lfOrientation = 900 ; lf.lfOrientation = 900 ;
hFont = CreateFontIndirect( &lf ) ; hFont = CreateFontIndirect( &lf ) ;
hFont = SelectObject( hDC, hFont ) ; hFont = (HFONT) SelectObject( hDC, hFont ) ;
GetTextExtentPoint( hDC, lpsz, ui, &Size ) ; GetTextExtentPoint( hDC, lpsz, ui, &Size ) ;
cx = rcCap.bottom - ((rcCap.bottom - rcCap.top - Size.cx) / 2) ; 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 ) ; lpsz, ui, NULL ) ;
} }
hFont = SelectObject( hDC, hFont ) ; hFont = (HFONT) SelectObject( hDC, hFont ) ;
DeleteObject( hFont ) ; DeleteObject( hFont ) ;
} }
else else
@ -931,7 +931,7 @@ BOOL PASCAL DrawCaption( HDC hDC, HWND hWnd, LPRECT lprc,
lf.lfPitchAndFamily = FF_SWISS ; lf.lfPitchAndFamily = FF_SWISS ;
hFont = CreateFontIndirect( &lf ) ; hFont = CreateFontIndirect( &lf ) ;
hFont = SelectObject( hDC, hFont ) ; hFont = (HFONT) SelectObject( hDC, hFont ) ;
GetTextExtentPoint( hDC, lpsz, ui, &Size ) ; GetTextExtentPoint( hDC, lpsz, ui, &Size ) ;
cx = rcCap.left + ((rcCap.right - rcCap.left - Size.cx) / 2) ; 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, ETO_CLIPPED, &rcCap,
lpsz, ui, NULL ) ; lpsz, ui, NULL ) ;
hFont = SelectObject( hDC, hFont ) ; hFont = (HFONT) SelectObject( hDC, hFont ) ;
DeleteObject( hFont ) ; DeleteObject( hFont ) ;
} }

View File

@ -128,7 +128,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODSt
#ifdef O_DRAW_NATIVE_API #ifdef O_DRAW_NATIVE_API
int nPrevMode = SetBkMode(hdc, TRANSPARENT); int nPrevMode = SetBkMode(hdc, TRANSPARENT);
HBRUSH hbr = CreateSolidBrush(colBack), HBRUSH hbr = CreateSolidBrush(colBack),
hPrevBrush = SelectObject(hdc, hbr); hPrevBrush = (HBRUSH) SelectObject(hdc, hbr);
RECT rectAll = { rc.GetLeft(), rc.GetTop(), rc.GetRight(), rc.GetBottom() }; RECT rectAll = { rc.GetLeft(), rc.GetTop(), rc.GetRight(), rc.GetBottom() };
FillRect(hdc, &rectAll, hbr); 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 = (HFONT)::GetStockObject(SYSTEM_FONT);
} }
HFONT hPrevFont = ::SelectObject(hdc, hfont); HFONT hPrevFont = (HFONT) ::SelectObject(hdc, hfont);
DrawState(hdc, NULL, NULL, DrawState(hdc, NULL, NULL,
(LPARAM)(const char *)m_strName, m_strName.Length(), (LPARAM)(const char *)m_strName, m_strName.Length(),
x, rc.y, rc.GetWidth(), rc.GetHeight(), x, rc.y, rc.GetWidth(), rc.GetHeight(),

View File

@ -271,7 +271,7 @@ bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap)
HDC dc2 = GetDC(NULL); HDC dc2 = GetDC(NULL);
HBITMAP tmpBitmap = ::CreateCompatibleBitmap(dc2, GetWidth(), GetHeight()); HBITMAP tmpBitmap = ::CreateCompatibleBitmap(dc2, GetWidth(), GetHeight());
ReleaseDC(NULL, dc2); ReleaseDC(NULL, dc2);
HBITMAP oldBitmap = ::SelectObject(dc, tmpBitmap); HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, tmpBitmap);
if ( Palette ) if ( Palette )
{ {
@ -342,7 +342,7 @@ wxMask *wxPNGReader::CreateMask(void)
HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL); HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL);
HDC dc = ::CreateCompatibleDC(NULL); HDC dc = ::CreateCompatibleDC(NULL);
HBITMAP oldBitmap = ::SelectObject(dc, hBitmap); HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, hBitmap);
int bgIndex = GetBGIndex(); int bgIndex = GetBGIndex();

View File

@ -171,7 +171,7 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt
wxWindow *win = CreateAbortWindow(parent, printout); wxWindow *win = CreateAbortWindow(parent, printout);
wxYield(); wxYield();
::SetAbortProc((HDC) dc->GetHDC(), (FARPROC) lpAbortProc); ::SetAbortProc((HDC) dc->GetHDC(), (int (_stdcall *)(HDC, int)) lpAbortProc);
if (!win) if (!win)
{ {

View File

@ -154,7 +154,7 @@ bool wxStaticBitmap::MSWOnDraw(WXDRAWITEMSTRUCT *item)
HDC hDC = lpDIS->hDC; HDC hDC = lpDIS->hDC;
HDC memDC = ::CreateCompatibleDC(hDC); HDC memDC = ::CreateCompatibleDC(hDC);
HBITMAP old = ::SelectObject(memDC, (HBITMAP) bitmap->GetHBITMAP()); HBITMAP old = (HBITMAP) ::SelectObject(memDC, (HBITMAP) bitmap->GetHBITMAP());
if (!old) if (!old)
return FALSE; return FALSE;

View File

@ -188,7 +188,7 @@ bool wxToolBar95::CreateTools(void)
// Now blit all the tools onto this bitmap // Now blit all the tools onto this bitmap
HDC memoryDC = ::CreateCompatibleDC(NULL); HDC memoryDC = ::CreateCompatibleDC(NULL);
HBITMAP oldBitmap = ::SelectObject(memoryDC, (HBITMAP) m_hBitmap); HBITMAP oldBitmap = (HBITMAP) ::SelectObject(memoryDC, (HBITMAP) m_hBitmap);
HDC memoryDC2 = ::CreateCompatibleDC(NULL); HDC memoryDC2 = ::CreateCompatibleDC(NULL);
int x = 0; int x = 0;
@ -201,7 +201,7 @@ bool wxToolBar95::CreateTools(void)
{ {
// wxPalette *palette = tool->m_bitmap1->GetPalette(); // 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 = */ /* int bltResult = */
BitBlt(memoryDC, x, 0, (int) m_defaultWidth, (int) m_defaultHeight, memoryDC2, BitBlt(memoryDC, x, 0, (int) m_defaultWidth, (int) m_defaultHeight, memoryDC2,
0, 0, SRCCOPY); 0, 0, SRCCOPY);
@ -506,7 +506,7 @@ void wxMapBitmap(HBITMAP hBitmap, int width, int height)
if (hdcMem) if (hdcMem)
{ {
hbmOld = SelectObject(hdcMem, hBitmap); hbmOld = (HBITMAP) SelectObject(hdcMem, hBitmap);
int i, j, k; int i, j, k;
for ( i = 0; i < width; i++) for ( i = 0; i < width; i++)

View File

@ -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. // krj - create a new bitmap and copy the image from hdc.
//HBITMAP bitmapOld = SelectObject(hdcGlyphs, hBitmap); //HBITMAP bitmapOld = SelectObject(hdcGlyphs, hBitmap);
HBITMAP hBitmap = CreateCompatibleBitmap((HDC) hdc, dx, dy); 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); BitBlt(hdcGlyphs, 0,0, dx, dy, (HDC) hdc, 0, 0, SRCCOPY);
// initalize whole area with 1's // 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__) #if !defined(__WIN32__) && !defined(__WIN386__)
HBITMAP bitmapOld; HBITMAP bitmapOld;
if (tool->m_bitmap2.Ok()) if (tool->m_bitmap2.Ok())
bitmapOld = SelectObject(hdcGlyphs, (HBITMAP) tool->m_bitmap2.GetHBITMAP()); bitmapOld = (HBITMAP) SelectObject(hdcGlyphs, (HBITMAP) tool->m_bitmap2.GetHBITMAP());
else else
bitmapOld = SelectObject(hdcGlyphs, (HBITMAP) tool->m_bitmap1.GetHBITMAP()); bitmapOld = (HBITMAP) SelectObject(hdcGlyphs, (HBITMAP) tool->m_bitmap1.GetHBITMAP());
#else #else
HBITMAP bitmapOld = SelectObject(hdcGlyphs, (HBITMAP) tool->m_bitmap1.GetHBITMAP()); HBITMAP bitmapOld = (HBITMAP) SelectObject(hdcGlyphs, (HBITMAP) tool->m_bitmap1.GetHBITMAP());
#endif #endif
// calculate offset of face from (x,y). y is always from the top, // 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)) { if (!(state & wxTBSTATE_INDETERMINATE)) {
hbr = CreateSolidBrush(m_rgbHilight); hbr = CreateSolidBrush(m_rgbHilight);
if (hbr) { if (hbr) {
hbrOld = SelectObject((HDC) hdc, hbr); hbrOld = (HBRUSH) SelectObject((HDC) hdc, hbr);
if (hbrOld) { if (hbrOld) {
// draw hilight color where we have 0's in the mask // 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); 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 // gray out glyph
hbr = CreateSolidBrush(m_rgbShadow); hbr = CreateSolidBrush(m_rgbShadow);
if (hbr) { if (hbr) {
hbrOld = SelectObject((HDC) hdc, hbr); hbrOld = (HBRUSH) SelectObject((HDC) hdc, hbr);
if (hbrOld) { if (hbrOld) {
// draw the shadow color where we have 0's in the mask // 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); 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)) { if (state & (wxTBSTATE_CHECKED | wxTBSTATE_INDETERMINATE)) {
hbrOld = SelectObject((HDC) hdc, (HBRUSH) m_hbrDither); hbrOld = (HBRUSH) SelectObject((HDC) hdc, (HBRUSH) m_hbrDither);
if (hbrOld) { if (hbrOld) {
if (!bMaskCreated) if (!bMaskCreated)
@ -817,7 +817,7 @@ WXHBITMAP wxToolBarMSW::CreateMappedBitmap(WXHINSTANCE WXUNUSED(hInstance), void
// hbm = CreateDiscardableBitmap(hdc, i, hgt); // hbm = CreateDiscardableBitmap(hdc, i, hgt);
hbm = CreateCompatibleBitmap(hdc, i, hgt); hbm = CreateCompatibleBitmap(hdc, i, hgt);
if (hbm) { if (hbm) {
hbmOld = SelectObject(hdcMem, hbm); hbmOld = (HBITMAP) SelectObject(hdcMem, hbm);
// set the main image // set the main image
StretchDIBits(hdcMem, 0, 0, wid, hgt, 0, 0, wid, hgt, lpBits, StretchDIBits(hdcMem, 0, 0, wid, hgt, 0, 0, wid, hgt, lpBits,

View File

@ -171,7 +171,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
HWND edit = CreateWindowEx(exStyle, windowClass, NULL, HWND edit = CreateWindowEx(exStyle, windowClass, NULL,
msStyle, msStyle,
0, 0, 0, 0, (HWND) ((wxWindow*)parent)->GetHWND(), (HMENU)m_windowId, 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 CTL3D
if ( want3D ) if ( want3D )

View File

@ -807,7 +807,7 @@ void wxWindow::GetTextExtent(const wxString& string, int *x, int *y,
if (fontToUse && fontToUse->Ok()) if (fontToUse && fontToUse->Ok())
{ {
if ((fnt=(HFONT) fontToUse->GetResourceHandle())) if ((fnt=(HFONT) fontToUse->GetResourceHandle()))
was = SelectObject(dc,fnt) ; was = (HFONT) SelectObject(dc,fnt) ;
} }
SIZE sizeRect; SIZE sizeRect;
@ -1686,7 +1686,7 @@ void wxWindow::MSWOnDropFiles(WXWPARAM wParam)
wxDebugMsg("wxWindow::MSWOnDropFiles %d\n", m_hWnd); wxDebugMsg("wxWindow::MSWOnDropFiles %d\n", m_hWnd);
#endif #endif
HANDLE hFilesInfo = (HANDLE)wParam; HDROP hFilesInfo = (HDROP) wParam;
POINT dropPoint; POINT dropPoint;
DragQueryPoint(hFilesInfo, (LPPOINT) &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->UseResource();
// the_font->RealizeResource(); // the_font->RealizeResource();
if ((fnt=(HFONT) the_font->GetResourceHandle())) if ((fnt=(HFONT) the_font->GetResourceHandle()))
was = SelectObject(dc,fnt) ; was = (HFONT) SelectObject(dc,fnt) ;
} }
GetTextMetrics(dc, &tm); GetTextMetrics(dc, &tm);
if (the_font && fnt && was) if (the_font && fnt && was)

View File

@ -141,9 +141,9 @@ PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH) /Fd$(WXDIR)\lib\wx.pdb
MAKEPRECOMP=/YcWX/WXPREC.H MAKEPRECOMP=/YcWX/WXPREC.H
!endif !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 # 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 LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -entry:WinMainCRTStartup
DUMMY=dummy DUMMY=dummy