]> git.saurik.com Git - wxWidgets.git/blobdiff - docs/html/faqmsw.htm
Unicode compilation fix
[wxWidgets.git] / docs / html / faqmsw.htm
index cf82acb1378793ba9ea1d101a469f879728d1502..346e9de28d49eaad17ce809d410b745eb2df6fa3 100644 (file)
@@ -35,6 +35,7 @@ See also <a href="faq.htm">top-level FAQ page</a>.
 <li><a href="#dll">Can you compile wxWindows 2 as a DLL?</a></li>
 <li><a href="#exesize">How can I reduce executable size?</a></li>
 <li><a href="#mfc">Is wxWindows compatible with MFC?</a></li>
 <li><a href="#dll">Can you compile wxWindows 2 as a DLL?</a></li>
 <li><a href="#exesize">How can I reduce executable size?</a></li>
 <li><a href="#mfc">Is wxWindows compatible with MFC?</a></li>
+<li><a href="#asuffix">Why do I get errors about FooBarA when I only use FooBar in my program?</a></li>
 <li><a href="#newerrors">Why my code fails to compile with strange errors about new operator?</a></li>
 <li><a href="#mfcport">How do I port MFC applications to wxWindows?</a></li>
 <li><a href="#crash">Why do I sometimes get bizarre crash problems using VC++ 5/6?</a></li>
 <li><a href="#newerrors">Why my code fails to compile with strange errors about new operator?</a></li>
 <li><a href="#mfcport">How do I port MFC applications to wxWindows?</a></li>
 <li><a href="#crash">Why do I sometimes get bizarre crash problems using VC++ 5/6?</a></li>
@@ -201,7 +202,8 @@ Statically-linked wxWindows 2 programs are smaller than wxWindows 1.xx programs,
 wxWindows 2 has been designed to reduce dependencies between classes, and other
 techniques. The linker will not include code from the library that is not (directly or
 indirectly) referenced
 wxWindows 2 has been designed to reduce dependencies between classes, and other
 techniques. The linker will not include code from the library that is not (directly or
 indirectly) referenced
-by your application. So for example, the &#39;minimal&#39; sample is less than 300KB using VC++ 6.<P>
+by your application. So for example, the &#39;minimal&#39; sample is less than 500KB using VC++ 6
+(note that this figure may be greater for the latest version of wxWindows).<P>
 
 If you want to distribute really small executables, you can
 use <a href="http://www.un4seen.com/petite/" target=_top>Petite</a>
 
 If you want to distribute really small executables, you can
 use <a href="http://www.un4seen.com/petite/" target=_top>Petite</a>
@@ -210,12 +212,37 @@ will shrink to a mere 250KB. With this sort of size, there is reduced incentive
 use DLLs. Another good compression tool is <a href="http://upx.sourceforge.net/" target=_top>UPX</a>.
 <P>
 
 use DLLs. Another good compression tool is <a href="http://upx.sourceforge.net/" target=_top>UPX</a>.
 <P>
 
+Please do not be surprised if MinGW produces a statically-linked minimal executable of 1 MB. Firstly, gcc
+produces larger executables than some compilers. Secondly, this figure will
+include most of the overhead of wxWindows, so as your application becomes more
+complex, the overhead becomes proportionaly less significant. And thirdly, trading executable compactness
+for the enormous increase in productivity you get with wxWindows is almost always well worth it.
+
 <H3><a name="mfc">Is wxWindows compatible with MFC?</a></H3>
 
 There is a sample which demonstrates MFC and wxWindows code co-existing in the same
 application. However, don&#39;t expect to be able to enable wxWindows windows with OLE-2
 functionality using MFC.<P>
 
 <H3><a name="mfc">Is wxWindows compatible with MFC?</a></H3>
 
 There is a sample which demonstrates MFC and wxWindows code co-existing in the same
 application. However, don&#39;t expect to be able to enable wxWindows windows with OLE-2
 functionality using MFC.<P>
 
+<H3><a name="asuffix">Why do I get errors about FooBarA when I only use FooBar in my program?</H3>
+
+If you get errors like
+<p>
+<center>
+<tt>no matching function for call to &#39;wxDC::DrawTextA(const char[5], int,
+int)&#39;</tt>
+</center>
+<p>
+or similar ones for the other functions, i.e. the compiler error messages
+mention the function with the <tt>&#39;A&#39;</tt> suffix while you didn&#39;t
+use it in your code, the explanation is that you had included
+<tt>&#60;windows.h&#062;</tt> header which redefines many symbols to have such
+suffix (or <tt>&#39;W&#39;</tt> in the Unicode builds).
+
+<p>
+The fix is to either not include <tt>&#60;windows.h&#62;</tt> at all or include
+<tt>"wx/msw/winundef.h"</tt> immediately after it.
+
 <H3><a name="newerrors">Why my code fails to compile with strange errors about new operator?</a></H3>
 
 The most common cause of this problem is the memory debugging settings in
 <H3><a name="newerrors">Why my code fails to compile with strange errors about new operator?</a></H3>
 
 The most common cause of this problem is the memory debugging settings in
@@ -305,7 +332,7 @@ The templates are described in tmake ref manual (1-2 pages of text)
 and are quite simple. They do contain some Perl code, but my Perl is
 primitive (very C like) so it should be possible for anybody to make
 trivial modifications to it (I hope that only trivial modifications
 and are quite simple. They do contain some Perl code, but my Perl is
 primitive (very C like) so it should be possible for anybody to make
 trivial modifications to it (I hope that only trivial modifications
-will be needed). I&#39;ve tagged the old makefiles as MAKEFILES_WITHOUT_TMAKE
+will be needed). I&#39;ve tagged the ol makefiles as MAKEFILES_WITHOUT_TMAKE
 in the cvs, so you can always retrieve them and compare the new ones,
 this will make it easier to solve the problems you might have.<P>
 
 in the cvs, so you can always retrieve them and compare the new ones,
 this will make it easier to solve the problems you might have.<P>
 
@@ -373,7 +400,11 @@ VZ
 
 This can happen if you have a child window intercepting EVT_CHAR events and swallowing
 all keyboard input. You should ensure that event.Skip() is called for all input that
 
 This can happen if you have a child window intercepting EVT_CHAR events and swallowing
 all keyboard input. You should ensure that event.Skip() is called for all input that
-isn&#39;used by the event handler.
+isn&#39;used by the event handler.<P>
+
+It can also happen if you append the submenu to the parent
+menu {\it before} you have added your menu items. Do the append {\it after} adding
+your items, or accelerators may not be registered properly.<P>
 
 <H3><a name="#regconfig">Why can I not write to the HKLM part of the registry with wxRegConfig?</a></H3>
 
 
 <H3><a name="#regconfig">Why can I not write to the HKLM part of the registry with wxRegConfig?</a></H3>