Problem with manifest file
-
VS2008 puts a manifest file in my exe automatically (the "embedding manifest" build step). But when I start the exe it shows the dialogs in the classic theme. I opened the exe in the resource editor and noticed that the manifest lacked "Common Controls" section. How can I fix that?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
-
VS2008 puts a manifest file in my exe automatically (the "embedding manifest" build step). But when I start the exe it shows the dialogs in the classic theme. I opened the exe in the resource editor and noticed that the manifest lacked "Common Controls" section. How can I fix that?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
WTF?! Why does the New Project Wizard add the #ifdef _UNICODE...#endif
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endifin the code that adds the XP style buttons. This code was created by the wizard, no changes from me. It basically means "I'll create a manifest for you unless your program is ANSI, in which case f**k you". When I removed the #ifdef everything worked without problems. The only purpose for putting it seems to be to make me waste an hour wondering why I don't have visual styles, and creating 2 projects one with manifest one without, and comparing them with WinMerge, before noticing this little insidious #ifdef. And I'm sure there are people who don't know about the whole manifest thing, they'd be stuck with ugly controls if they make an ANSI project. I've made my project ANSI from the beginning since I had to add a lot of code that won't compile if it's unicode.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
-
WTF?! Why does the New Project Wizard add the #ifdef _UNICODE...#endif
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endifin the code that adds the XP style buttons. This code was created by the wizard, no changes from me. It basically means "I'll create a manifest for you unless your program is ANSI, in which case f**k you". When I removed the #ifdef everything worked without problems. The only purpose for putting it seems to be to make me waste an hour wondering why I don't have visual styles, and creating 2 projects one with manifest one without, and comparing them with WinMerge, before noticing this little insidious #ifdef. And I'm sure there are people who don't know about the whole manifest thing, they'd be stuck with ugly controls if they make an ANSI project. I've made my project ANSI from the beginning since I had to add a lot of code that won't compile if it's unicode.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
sashoalm wrote:
WTF?! Why does the New Project Wizard add the #ifdef _UNICODE...#endif
Because technically... common controls 6 and above does not have full ANSI support. Some window messages will be returning Unicode text buffers if you use common controls 6 in an ANSI build. Depending on your application architecture... you may or may not bump into this limitation. Best Wishes, -David Delaune