Madz
Madz

Reputation: 1279

MFC applications' visual appearence changed after changing character set

Initially my application was built on the Unicode character set (project properties -> general -> character set), however due to unavoidable reasons I had to use Multi-byte character set. And immediately the appearance of the property sheet become a lot less appealing. The edit boxes were sunken and buttons, tabs were not rounded and the colour of the sheet was changed. This changes affected my property sheet, pages and dialog boxes. How do I get the application to look normal. I use Windows 7.

Thanks.

Upvotes: 0

Views: 999

Answers (1)

Artashes Budaghyan
Artashes Budaghyan

Reputation: 238

You need to use Unicode char set or modify your file stdafx.h. There you can see this kind of code :

#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_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
#endif

You can remove the first #ifdef _UNICODE and in the end #endif and you will get new style of controls with Multy byte char set , but it is not very good idea, some of MFC controls (especially new controls in VS 2010 , for example CMFCButton control) have problems in non Unicode char set programs with new styles of view. Or you need to change back to Unicode application or with some controls you can have Big problems.

Upvotes: 1

Related Questions