diff --git a/include/wx/dynlib.h b/include/wx/dynlib.h
index e6b0bc8c14..5f5a9f4f01 100644
--- a/include/wx/dynlib.h
+++ b/include/wx/dynlib.h
@@ -40,7 +40,7 @@
# include
typedef shl_t wxDllType;
#elif defined(__WINDOWS__)
-# include
+//# include
typedef HMODULE wxDllType;
#elif defined(__OS2__)
# define INCL_DOS
diff --git a/include/wx/wxprec.h b/include/wx/wxprec.h
index 6f28387b89..df5e797186 100644
--- a/include/wx/wxprec.h
+++ b/include/wx/wxprec.h
@@ -29,7 +29,7 @@
// include standard Windows headers
#ifdef __WXMSW__
- #include
+// #include
#include "wx/msw/winundef.h"
#endif
diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp
index a3676830c7..40700df5af 100644
--- a/src/common/cmdline.cpp
+++ b/src/common/cmdline.cpp
@@ -37,6 +37,8 @@
#include "wx/filefn.h"
#endif //WX_PRECOMP
+#include
+
#include "wx/datetime.h"
#include "wx/cmdline.h"
diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp
index 5326de0e31..b2f65e9f61 100644
--- a/src/common/datetime.cpp
+++ b/src/common/datetime.cpp
@@ -75,6 +75,8 @@
#define wxDEFINE_TIME_CONSTANTS // before including datetime.h
+#include
+
#include "wx/datetime.h"
// ----------------------------------------------------------------------------
diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp
index 5086123d93..eca2040c2b 100644
--- a/src/common/dynlib.cpp
+++ b/src/common/dynlib.cpp
@@ -22,6 +22,9 @@
#endif
#include "wx/wxprec.h"
+#if defined(__WINDOWS__)
+#include "wx/msw/private.h"
+#endif
#ifdef __BORLANDC__
#pragma hdrstop
@@ -42,10 +45,11 @@
# define wxDllOpen(lib) dlopen(lib.fn_str(), RTLD_NOW/*RTLD_LAZY*/)
# define wxDllGetSymbol(handle, name) dlsym(handle, name.mb_str())
# define wxDllClose dlclose
+aaa=1
#elif defined(HAVE_SHL_LOAD)
# define wxDllOpen(lib) shl_load(lib.fn_str(), BIND_DEFERRED, 0)
# define wxDllClose shl_unload
-
+bbb=1
static inline void *wxDllGetSymbol(shl_t handle, const wxString& name)
{
void *sym;
@@ -55,8 +59,6 @@
return (void *)0;
}
#elif defined(__WINDOWS__)
-# include
-
// using LoadLibraryEx under Win32 to avoid name clash with LoadLibrary
# ifdef __WIN32__
# define wxDllOpen(lib) ::LoadLibraryEx(lib, 0, 0)
diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp
index 9f16ca8512..ff228f99dc 100644
--- a/src/common/menucmn.cpp
+++ b/src/common/menucmn.cpp
@@ -24,6 +24,8 @@
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#include
+
#ifdef __BORLANDC__
#pragma hdrstop
#endif
diff --git a/src/common/serbase.cpp b/src/common/serbase.cpp
index cea2ce5efb..7ad3a46705 100644
--- a/src/common/serbase.cpp
+++ b/src/common/serbase.cpp
@@ -15,6 +15,9 @@
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#if defined(__WINDOWS__)
+#include "wx/msw/private.h"
+#endif
#include "wx/serbase.h"
#include "wx/datstrm.h"
diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp
index fbda0e031f..50135649aa 100644
--- a/src/msw/dc.cpp
+++ b/src/msw/dc.cpp
@@ -23,6 +23,7 @@
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#include "wx/msw/private.h" // needs to be before #include
#ifdef __BORLANDC__
#pragma hdrstop
@@ -56,8 +57,6 @@
#include
#endif
-#include "wx/msw/private.h"
-
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
// ---------------------------------------------------------------------------
diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp
index aad7149867..c23defa839 100644
--- a/src/msw/dialup.cpp
+++ b/src/msw/dialup.cpp
@@ -38,6 +38,8 @@
#include "wx/event.h"
#endif
+#include "wx/msw/private.h" // must be before #include "dynlib.h"
+
#if !wxUSE_DYNLIB_CLASS
#error You need wxUSE_DYNLIB_CLASS to be 1 to compile dialup.cpp.
#endif
@@ -54,8 +56,6 @@
#include
-#include "wx/msw/private.h"
-
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp
index 55757f2ea6..a2793f86bc 100644
--- a/src/msw/dragimag.cpp
+++ b/src/msw/dragimag.cpp
@@ -15,6 +15,7 @@
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#include "wx/msw/private.h"
#ifdef __BORLANDC__
#pragma hdrstop
diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp
index 17612e6fca..a96c48e52b 100644
--- a/src/msw/filedlg.cpp
+++ b/src/msw/filedlg.cpp
@@ -15,6 +15,7 @@
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#include "wx/msw/private.h"
#ifdef __BORLANDC__
#pragma hdrstop
@@ -28,7 +29,7 @@
#include "wx/intl.h"
#include "wx/log.h"
- #include "wx/msw/private.h"
+// #include "wx/msw/private.h"
#endif
#if !defined(__WIN32__) || defined(__SALFORDC__) || defined(__WXWINE__)
diff --git a/src/msw/ownerdrw.cpp b/src/msw/ownerdrw.cpp
index 2c2ec2a8ea..8ea7c54e0f 100644
--- a/src/msw/ownerdrw.cpp
+++ b/src/msw/ownerdrw.cpp
@@ -15,6 +15,7 @@
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#include "wx/msw/private.h"
#ifdef __BORLANDC__
#pragma hdrstop
@@ -22,7 +23,7 @@
#ifndef WX_PRECOMP
#include "wx/window.h"
- #include "wx/msw/private.h"
+// #include "wx/msw/private.h"
#include "wx/font.h"
#include "wx/bitmap.h"
#include "wx/dcmemory.h"