News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Patch for wxWidgets Technote 19 Issues (tn0019.txt)

Started by stahta01, November 04, 2013, 08:27:51 AM

Previous topic - Next topic

stahta01

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.


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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]