MFC工程UNICODE變為Multi-Byte,風格變了
前陣子做的工程是VS2008的風格,但是不知道改了什麼東西就風格變成原始VC6.0的了。
弄了半天,發現是選擇了“Use Multi-Byte Character Set”選項,因為要做很多asc碼的處理。
VC6中使用外部manifest檔案,而vc10中自帶有,在stdafx.h中有manifest選擇。
下面是程式碼:
#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
只有UNICODE才有,注掉就OK了。但願不會帶來其他問題!