diff --git a/docs/changes.txt b/docs/changes.txt index 1178a107d8..d50ccb9359 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -496,6 +496,11 @@ Build system changes configurations if you need them is to use nmake from the command line with WXUNIV=1 or UNICODE=0 command line parameter respectively. +- The manifest is not included by wx/msw/wx.rc any longer for MSVC compiler. + If you're using MSVC 6 or 7 which require it, you must explicitly define + wxUSE_RC_MANIFEST=1 and also predefine WX_CPU_X86 in the resource compiler + options in your project file. + Major new features in this release ---------------------------------- diff --git a/docs/doxygen/mainpages/const_wxusedef.h b/docs/doxygen/mainpages/const_wxusedef.h index d38f5c3a6b..e4cf760469 100644 --- a/docs/doxygen/mainpages/const_wxusedef.h +++ b/docs/doxygen/mainpages/const_wxusedef.h @@ -342,7 +342,8 @@ library: @itemdef{wxUSE_HOTKEY, Use wxWindow::RegisterHotKey() and wxWindow::UnregisterHotKey} @itemdef{wxUSE_INKEDIT, Use InkEdit library. Related to Tablet PCs.} @itemdef{wxUSE_MS_HTML_HELP, Use wxCHMHelpController class.} -@itemdef{wxUSE_NO_MANIFEST, Use to prevent the auto generation, under MSVC, of manifest file needed by windows XP and above.} +@itemdef{wxUSE_NO_MANIFEST, Can be predefined to disable inclusion of the +manifest from wxWidgets RC file. See also wxUSE_RC_MANIFEST.} @itemdef{wxUSE_NORLANDER_HEADERS, Using headers whose author is Anders Norlander.} @itemdef{wxUSE_OLE, Enables OLE helper routines.} @itemdef{wxUSE_OLE_AUTOMATION, Enable OLE automation utilities.} @@ -350,6 +351,11 @@ library: @itemdef{wxUSE_PENWINDOWS, See src/msw/penwin.cpp file.} @itemdef{wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW, Use PS printing in wxMSW.} @itemdef{wxUSE_PS_PRINTING, See src/msw/dcprint.cpp file.} +@itemdef{wxUSE_RC_MANIFEST, Include manifest for common controls library v6 +from wxWidgets RC file. This may be needed to be defined explicitly for MSVC 6 +and 7 (98 and 2003) only as later versions of MSVC generate this manifest +themselves and the manifest generation is enabled by default for the other +compilers. See also wxUSE_NO_MANIFEST.} @itemdef{wxUSE_REGKEY, Use wxRegKey class.} @itemdef{wxUSE_RICHEDIT, Enable use of riched32.dll in wxTextCtrl} @itemdef{wxUSE_RICHEDIT2, Enable use of riched20.dll in wxTextCtrl} diff --git a/docs/msw/install.txt b/docs/msw/install.txt index 123d796484..54ecc1e72b 100644 --- a/docs/msw/install.txt +++ b/docs/msw/install.txt @@ -797,6 +797,8 @@ following to use wxWidgets: - _UNICODE unless you want to use deprecated ANSI build of wxWidgets. - NDEBUG if you want to build in release mode, i.e. disable asserts. - WXUSINGDLL if you are using DLL build of wxWidgets. +* If using MSVC 6 or 7 only (i.e. not for later versions), also define + wxUSE_RC_MANIFEST=1 and WX_CPU_X86. * Add $WXWIN/lib/prefix_lib-or-dll to the libraries path. The prefix depends on the compiler, by default it is "vc" for MSVC, "gcc" for g++ and so on. * Add the list of libraries to link with to the linker input. The exact list diff --git a/include/wx/msw/genrcdefs.h b/include/wx/msw/genrcdefs.h index 4dfb6c1c0a..a69638e9ba 100644 --- a/include/wx/msw/genrcdefs.h +++ b/include/wx/msw/genrcdefs.h @@ -13,7 +13,9 @@ EMIT(#ifndef _WX_RCDEFS_H) EMIT(#define _WX_RCDEFS_H) #ifdef _MSC_FULL_VER -EMIT(#define WX_MSC_FULL_VER _MSC_FULL_VER) +#if _MSC_FULL_VER < 140040130 +EMIT(#define wxUSE_RC_MANIFEST 1) +#endif #endif #ifdef _M_AMD64 diff --git a/include/wx/msw/rcdefs.h b/include/wx/msw/rcdefs.h index c5ef7d1f62..75e5d15a3d 100644 --- a/include/wx/msw/rcdefs.h +++ b/include/wx/msw/rcdefs.h @@ -10,6 +10,33 @@ #ifndef _WX_RCDEFS_H #define _WX_RCDEFS_H -#define WX_CPU_X86 +#ifdef __GNUC__ + // We must be using windres which uses gcc as its preprocessor. We do need + // to generate the manifest then as gcc doesn't do it automatically and we + // can define the architecture macro on our own as all the usual symbols + // are available (unlike with Microsoft RC.EXE which doesn't predefine + // anything useful at all). + #ifndef wxUSE_RC_MANIFEST + #define wxUSE_RC_MANIFEST 1 + #endif + + #if defined __i386__ + #ifndef WX_CPU_X86 + #define WX_CPU_X86 + #endif + #elif defined __x86_64__ + #ifndef WX_CPU_AMD64 + #define WX_CPU_AMD64 + #endif + #elif defined __ia64__ + #ifndef WX_CPU_IA64 + #define WX_CPU_IA64 + #endif + #endif +#endif + +// Don't do anything here for the other compilers, in particular don't define +// WX_CPU_X86 here as we used to do. If people define wxUSE_RC_MANIFEST, they +// must also define the architecture constant correctly. #endif diff --git a/include/wx/msw/wx.rc b/include/wx/msw/wx.rc index d9aff3b171..771779f447 100644 --- a/include/wx/msw/wx.rc +++ b/include/wx/msw/wx.rc @@ -90,14 +90,15 @@ wxBITMAP_STD_COLOURS BITMAP "wx/msw/colours.bmp" ////////////////////////////////////////////////////////////////////////////// // -// Manifest file for Windows XP +// Include manifest file for common controls library v6 required to use themes. +// +// Predefining wxUSE_NO_MANIFEST as 1 always disables the use of the manifest. +// Otherwise we include it only if wxUSE_RC_MANIFEST is defined as 1. // #if !defined(wxUSE_NO_MANIFEST) || (wxUSE_NO_MANIFEST == 0) -// Visual Studio 2005 generates the manifest automatically and so we -// shouldn't include it in the resources manually: -#if !defined(WX_MSC_FULL_VER) || WX_MSC_FULL_VER < 140040130 +#if defined(wxUSE_RC_MANIFEST) && wxUSE_RC_MANIFEST // see "about isolated applications" topic in MSDN #ifdef ISOLATION_AWARE_ENABLED @@ -112,8 +113,16 @@ wxMANIFEST_ID 24 "wx/msw/amd64.manifest" wxMANIFEST_ID 24 "wx/msw/ia64.manifest" #elif defined(WX_CPU_X86) wxMANIFEST_ID 24 "wx/msw/wx.manifest" +#else +// Notice that if the manifest is included, WX_CPU_XXX constant corresponding +// to the architecture we're compiling for must be defined. This can be done +// either manually in your make/project file or by configuring the resource +// compiler paths to search in $(WXWIN)/lib/$(COMPILER_PREFIX)_lib/mswu[d] +// directory for its include files, as wx/msw/rcdefs.h file in this directory +// is generated during wxWidgets build and contains the correct definition. +#error "One of WX_CPU_XXX constants must be defined. See comment above." #endif -#endif // !defined(WX_MSC_FULL_VER) || WX_MSC_FULL_VER < 140040130 +#endif // wxUSE_RC_MANIFEST #endif // !defined(wxUSE_NO_MANIFEST) || (wxUSE_NO_MANIFEST == 0)