#include "wx/msw/microwin.h"
#endif
-// Include fixes for MSLU:
-#include "wx/msw/mslu.h"
-
#include "wx/log.h"
class WXDLLEXPORT wxFont;
// Intel, Visual Age.
#if defined(__WXWINCE__)
#define wxGetOSFHandle(fd) ((HANDLE)fd)
+ #define wxOpenOSFHandle(h, flags) ((int)wxPtrToUInt(h))
#elif defined(__CYGWIN__)
#define wxGetOSFHandle(fd) ((HANDLE)get_osfhandle(fd))
#elif defined(__VISUALC__) \
|| defined(__MINGW32__) \
|| (defined(__MWERKS__) && defined(__MSL__))
#define wxGetOSFHandle(fd) ((HANDLE)_get_osfhandle(fd))
+ #define wxOpenOSFHandle(h, flags) (_open_osfhandle(wxPtrToUInt(h), flags))
+ #define wx_fdopen _fdopen
#endif
// close the handle in the class dtor
RECT rect;
if ( !::GetWindowRect(hwnd, &rect) )
- {
wxLogLastError(_T("GetWindowRect"));
- }
return rect;
}
RECT rect;
if ( !::GetClientRect(hwnd, &rect) )
- {
wxLogLastError(_T("GetClientRect"));
- }
return rect;
}
{
m_ptr = GlobalLock(hGlobal);
if ( !m_ptr )
- {
wxLogLastError(_T("GlobalLock"));
- }
}
~GlobalPtrLock()
#else // __WIN32__
-#ifdef __VISUALC__
- // strangely enough, VC++ 7.1 gives warnings about 32 -> 64 bit conversions
- // in the functions below, even in spite of the explicit casts
- #pragma warning(disable:4311)
- #pragma warning(disable:4312)
-#endif
-
-inline void *wxGetWindowProc(HWND hwnd)
+// note that the casts to LONG_PTR here are required even on 32-bit machines
+// for the 64-bit warning mode of later versions of MSVC (C4311/4312)
+inline WNDPROC wxGetWindowProc(HWND hwnd)
{
- return (void *)::GetWindowLong(hwnd, GWL_WNDPROC);
+ return (WNDPROC)(LONG_PTR)::GetWindowLong(hwnd, GWL_WNDPROC);
}
inline void *wxGetWindowUserData(HWND hwnd)
{
- return (void *)::GetWindowLong(hwnd, GWL_USERDATA);
+ return (void *)(LONG_PTR)::GetWindowLong(hwnd, GWL_USERDATA);
}
inline WNDPROC wxSetWindowProc(HWND hwnd, WNDPROC func)
{
- return (WNDPROC)::SetWindowLong(hwnd, GWL_WNDPROC, (LONG)func);
+ return (WNDPROC)(LONG_PTR)::SetWindowLong(hwnd, GWL_WNDPROC, (LONG_PTR)func);
}
inline void *wxSetWindowUserData(HWND hwnd, void *data)
{
- return (void *)::SetWindowLong(hwnd, GWL_USERDATA, (LONG)data);
+ return (void *)(LONG_PTR)::SetWindowLong(hwnd, GWL_USERDATA, (LONG_PTR)data);
}
-#ifdef __VISUALC__
- #pragma warning(default:4311)
- #pragma warning(default:4312)
-#endif
-
#endif // __WIN64__/__WIN32__
#endif // wxUSE_GUI