Author Topic: Patch for wxWidgets Technote 19 Issues (tn0019.txt)  (Read 3543 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Patch for wxWidgets Technote 19 Issues (tn0019.txt)
« on: November 04, 2013, 08:27:51 am »
Quote from tn0019.txt

Quote
In no event should the Windows headers such as <windows.h> or <commctrl.h> be
included directly. So instead of #include <...> use "wx/msw/wrapwin.h" or
"wx/msw/wrapcctl.h".

Patch for the areas that happen in the past few years.
Note: There are several other ones; that I did NOT patch because it was NOT in wxWidget code.

Code
Index: src/plugins/debuggergdb/gdb_driver.cpp
===================================================================
--- src/plugins/debuggergdb/gdb_driver.cpp (revision 9427)
+++ src/plugins/debuggergdb/gdb_driver.cpp (working copy)
@@ -22,7 +22,7 @@
 
 #ifdef __WXMSW__
 // for Registry detection of Cygwin
-#include <windows.h>
+#include "wx/msw/wrapwin.h"     // Wraps windows.h
 #endif
 
 #include <wx/arrimpl.cpp> // this is a magic incantation which must be done!
Index: src/plugins/contrib/wxSmithDateTimePicker/src/TimeCtrl.cpp
===================================================================
--- src/plugins/contrib/wxSmithDateTimePicker/src/TimeCtrl.cpp (revision 9427)
+++ src/plugins/contrib/wxSmithDateTimePicker/src/TimeCtrl.cpp (working copy)
@@ -13,7 +13,6 @@
 #include <wx/datectrl.h>
 #include <wx/dynlib.h>
 
-#include  <commctrl.h>
 
 #define _WX_DEFINE_TIME_EVENTS_
 #include <wx/dateevt.h>
Index: src/plugins/contrib/source_exporter/wxPdfDocument/src/pdffontparsertruetype.cpp
===================================================================
--- src/plugins/contrib/source_exporter/wxPdfDocument/src/pdffontparsertruetype.cpp (revision 9427)
+++ src/plugins/contrib/source_exporter/wxPdfDocument/src/pdffontparsertruetype.cpp (working copy)
@@ -39,7 +39,7 @@
 #ifdef __WXMSW__
 
 #include <stdio.h>
-#include <windows.h>
+#include "wx/msw/wrapwin.h"     // Wraps windows.h
 
 #include "wx/msw/private.h"
 

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org