+
<HTML>
<HEAD>
-<TITLE>wxWidgets 2 for Windows FAQ</TITLE>
+<TITLE>wxWidgets for Windows FAQ</TITLE>
</HEAD>
<BODY BGCOLOR=#FFFFFF TEXT=#000000 VLINK="#00376A" LINK="#00529C" ALINK="#313063">
<tr>
<td bgcolor="#004080" align=left height=24 background="images/bluetitlegradient.gif">
<font size=+1 face="Arial, Lucida Sans, Helvetica" color="#FFFFFF">
-<b>wxWidgets 2 for Windows FAQ</b>
+<b>wxWidgets for Windows FAQ</b>
</font>
</td>
</tr>
<li><a href="#wince">What about Windows CE?</a></li>
<li><a href="#winxp">What do I need to do for Windows XP?</a></li>
<li><a href="#compilers">What compilers are supported?</a></li>
-<li><a href="#bestcompiler">Which is the best compiler to use with wxWidgets 2?</a></li>
+<li><a href="#bestcompiler">Which is the best compiler to use with wxWidgets?</a></li>
<li><a href="#unicode">Is Unicode supported?</a></li>
<li><a href="#doublebyte">Does wxWidgets support double byte fonts (Chinese/Japanese/Korean etc.)?</a></li>
-<li><a href="#dll">Can you compile wxWidgets 2 as a DLL?</a></li>
+<li><a href="#dll">Can you compile wxWidgets as a DLL?</a></li>
<li><a href="#exesize">How can I reduce executable size?</a></li>
<li><a href="#mfc">Is wxWidgets compatible with MFC?</a></li>
<li><a href="#setuph">Why do I get errors about setup.h not being found?</a></li>
<li><a href="#shortcutproblem">Why are menu hotkeys or shortcuts not working in my application?</a></li>
<li><a href="#regconfig">Why can I not write to the HKLM part of the registry with wxRegConfig?</a></li>
<li><a href="#access">Is MS Active Accessibility supported?</a></li>
-<li><a href="#dspfmt">Why does Visual C++ complain about corrupted project files??</a></li>
+<li><a href="#dspfmt">Why does Visual C++ complain about corrupted project files?</a></li>
<li><a href="#crtmismatch">Visual C++ gives errors about multiply defined symbols, what can I do?</a></li>
+<li><a href="#directx">Why do I get compilation errors when using wxWidgets with DirectShow?</a></li>
+<li><a href="#handlewm">How do I handle Windows messages in my wxWidgets program?</a></li>
</ul>
<hr>
<h3><a name="platforms">Which Windows platforms are supported?</a></h3>
-wxWidgets 2 can be used to develop and deliver applications on Windows 3.1, Win32s,
-Windows 95, Windows 98, Windows NT, Windows 2000, and Windows XP. A Windows CE
-version is being looked into (see below).<P>
+wxWidgets can be used to develop and deliver applications on Windows 95, Windows 98, Windows NT,
+Windows 2000, Windows XP, and Windows Vista. A Windows CE
+port is also available (see below).<P>
-wxWidgets 2 is designed to make use of WIN32 features and controls. However, unlike Microsoft,
-we have not forgotten users of 16-bit Windows. Most features
-work under Windows 3.1, including wxTreeCtrl and wxListCtrl using the generic implementation.
-However, don't expect very Windows-95-specific classes to work, such as wxTaskBarIcon. The wxRegConfig
-class doesn't work either because the Windows 3.1 registry is very simplistic. Check out the 16-bit
-makefiles to see what other files have been left out.
-<P>
-16-bit compilation is supported under Visual C++ 1.5, and Borland BC++ 4 to 5.
+16-bit compilation is only supported for wxWidgets 2.4 and previous versions,
+using Visual C++ 1.5 and Borland BC++ 4 to 5.
<P>
-wxWidgets 2 for Windows will also compile on Unix with gcc using Wine from <a href="http://www.winehq.org" target=_top>WineHQ</a>.
+wxWidgets for Windows will also compile on Unix with gcc using Wine from <a href="http://www.winehq.org" target=_top>WineHQ</a>.
The resulting executables are Unix binaries that work with the Wine Windows API emulator.<P>
-You can also compile wxWidgets 2 for Windows on Unix with Cygwin or Mingw32, resulting
+You can also compile wxWidgets for Windows on Unix with Cygwin or Mingw32, resulting
in executables that will run on Windows. So in theory you could write your applications
using wxGTK or wxMotif, then check/debug your wxWidgets for Windows
programs with Wine, and finally produce an ix86 Windows executable using Cygwin/Mingw32,
<h3><a name="wince">What about Windows CE?</a></h3>
-This port is largely complete. For further information, see the <a href="http://www.wxwidgets.org/embedded.htm#wxwince">wxEmbedded</a> page.<P>
+This port supports Pocket PC 2002/2003 and MS Smartphone 2002/2003, using
+Embedded Visual C++ 3 or 4. For further information, see the wxMSW section in
+the wxWidgets Reference Manual, and also the <a href="http://www.wxwidgets.org/embedded.htm#wxwince">wxEmbedded</a> page.<P>
<h3><a name="winxp">What do I need to do for Windows XP?</a></h3>
+From wxWidgets 2.5, the XP manifest is included in wx/msw/wx.rc and
+so your application will be themed automatically so long as you include wx.rc
+in your own .rc file.<P>
+
+For versions of wxWidgets below 2.5, you need to provide the manifest
+explicitly, as follows.<p>
+
In the same directory as you have your executable (e.g. foo.exe) you
put a file called foo.exe.manifest in which you have something like
the following:
1 24 "winxp.manifest"
</PRE>
-In wxWidgets 2.5, this will be in the wx/msw/wx.rc and
-so will happen automatically so long as you include wx.rc
-in your own .rc file.<P>
-
For an explanation of this syntax, please see
<a href="http://delphi.about.com/library/bluc/text/uc111601a.htm" target=_new>this
article</a>.
<h3><a name="compilers">What compilers are supported?</a></h3>
-Please see the wxWidgets 2 for Windows install.txt file for up-to-date information, but
+Please see the wxWidgets for Windows install.txt file for up-to-date information, but
currently the following are known to work:<P>
<ul>
<P>
-<h3><a name="bestcompiler">Which is the best compiler to use with wxWidgets 2?</a></h3>
+<h3><a name="bestcompiler">Which is the best compiler to use with wxWidgets?</a></h3>
-It's partly a matter of taste, but I (JACS) prefer Visual C++ since the debugger is very
+It's partly a matter of taste, but some people prefer Visual C++ since the debugger is very
good, it's very stable, the documentation is extensive, and it generates small executables.
Since project files are plain text, it's easy for me to generate appropriate project files
for wxWidgets samples.<P>
Among the free compilers the best choice seem to be Borland C++ command line
tools and mingw32 (port of gcc to Win32). Both of them are supported by
-wxWidgets.
+wxWidgets. However BC++ has trouble compiling large executables statically,
+so you need to dynamically link the wxWidgets libraries.<p>
<h3><a name="unicode">Is Unicode supported?</a></h3>
<h3><a name="doublebyte">Does wxWidgets support double byte fonts (Chinese/Japanese/Korean etc.)?</a></h3>
-For Japanese under Win2000, it seems that wxWidgets has no problems to work
+For Japanese under Win2000, it seems that wxWidgets has no problems working
with double byte char sets (meaning DBCS, not Unicode). First you have to
install Japanese support on your Win2K system and choose for ANSI translation
<tt>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage=932</tt>
wxWidgets applications.
<p>
-<h3><a name="dll">Can you compile wxWidgets 2 as a DLL?</a></h3>
+<h3><a name="dll">Can you compile wxWidgets as a DLL?</a></h3>
Yes (using the Visual C++ or Borland C++ makefile), but be aware that distributing DLLs is a thorny issue
and you may be better off compiling statically-linked applications, unless you're
docs/msw/install.txt for details. You may find that using configure instead
of makefile.g95 is easier, particularly since you can maintain debug and
release versions of the library simultaneously, in different directories.
-Also, run 'strip' after linking to remove all traces of debug info.
+Also, run 'strip' after linking to remove all traces of debug info.
<P>
<H3><a name="mfc">Is wxWidgets compatible with MFC?</a></H3>
<H3><a name="setuph">Why do I get errors about setup.h not being found?</a></H3>
When you build the wxWidgets library, setup.h is copied
-from include/wx/msw/setup.h to e.g. lib/mswd/wx/setup.h (the path
+from include/wx/msw/setup.h to e.g. lib/vc_msw/mswd/wx/setup.h (the path
depends on the configuration you're building). So you need to add
this include path if building using the static Debug library:<P>
-lib/mswd<P>
+lib/vc_lib/mswd<P>
-or if building the static Release library, lib/msw.<P>
+or if building the static Release library, lib/vc_lib/msw.<P>
See also the <a href="http://wiki.wxwidgets.org/wiki.pl?Table_Of_Contents">wxWiki Contents</a>
for more information.<P>
<H3><a name="makefiles">How are the wxWidgets makefiles edited under Windows?</a></H3>
-As of wxWidgets 2.1, there is a new system written by Vadim Zeitlin, that
+wxWidgets 2.5.x and above uses Bakefile to generate makefiles, which
+is described in technical note 16 under docs/tech in your distribution.<p>
+
+For 2.4.x, there is a system written by Vadim Zeitlin that
generates the makefiles from templates using tmake.<P>
-Here are Vadim's notes:<P>
+Here are Vadim's notes on tmake:<P>
<blockquote>
To use these new makefiles, you don't need anything (but see below).
tmake can be found at
<a href="http://www.troll.no/freebies/tmake.html" target=_new>www.troll.no/freebies/tmake.html</a>.
-It's a Perl5 program and so it needs Perl (doh). There is a binary for
+It's a Perl5 program and so it needs Perl (doh). There is a binary for
Windows (available from the same page), but I haven't used it, so
I don't know if it works as flawlessly as "perl tmake" does (note
for people knowing Perl: don't try to run tmake with -w, it won't
<pre>tmake -t b32 wxwin.pro -o ../../src/msw/makefile.b32</pre><P>
-The makefiles are untested - I don't have any of Borland, Watcom or
+The makefiles are untested - I don't have any of Borland, Watcom or
Symantec and I don't have enough diskspace to recompile even with
VC6 using makefiles. The new makefiles are as close as possible to the
old ones, but not closer: in fact, there has been many strange things
regKey.SetName(idName);
{
- wxLogNull dummy;
+ wxLogNull dummy;
if (!regKey.Create())
{
idName = wxT("HKEY_CURRENT_USER\\SOFTWARE\\My Company\\My Product\\Stuff\\");
<P>
-<h3><a name="#dspfmt">Why does Visual C++ complain about corrupted project files??</a></h3>
+<h3><a name="#dspfmt">Why does Visual C++ complain about corrupted project files?</a></h3>
If you have downloaded the wxWidgets sources from the cvs using a Unix cvs
client or downloaded a daily snapshot in <tt>.tar.gz</tt> format, it is likely
But the most important thing is to use the <strong>same</strong> CRT setting for
all components of your project.
+<h3><a name="#directx">Why do I get compilation errors when using wxWidgets with DirectShow?</a></h3>
+
+If you get errors when including Microsoft DirectShow or DirectDraw headers,
+the following message from Peter Whaite could help:
+<blockquote>
+> This causes compilation errors within DirectShow:
+>
+> wxutil.h(125) : error C2065: 'EXECUTE_ASSERT' : undeclared identifier
+> amfilter.h(1099) : error C2065: 'ASSERT' : undeclared identifier
+
+The reason for this is that __WXDEBUG__ is also used by the DXSDK (9.0
+in my case) to '#pragma once' the contents of
+DXSDK/Samples/C++/DirectShow/BaseClasses/wxdebug.h. So if __WXDEBUG__
+is defined, then wxdebug.h doesn't get included, and the assert macros
+don't get defined. You have to #undef __WXDEBUG__ before including the
+directshow baseclass's <streams.h>.
+</blockquote>
+
+
+<h3><a name="#handlewm">How do I handle Windows messages in my wxWidgets program?</a></h3>
+
+To handle a Windows message you need to override a virtual
+<tt>MSWWindowProc()</tt> method in a wxWindow-derived class. You should then
+test if <tt>nMsg</tt> parameter is the message you need to process and perform
+the necessary action if it is or call the base class method otherwise.
+
+
</font>
</BODY>