I want my project to use UNICODE char. set. I have 4 project in one solution with projects properties "Character Set" set to "User Unicode Character Set". When I execute the code, an exception is raised in one of MFC file (viewprnt.cpp) one line "ENSURE(pInfo->m_strPageDesc.LoadString(AFX_IDS_PREVIEWPAGEDESC));".
When I go to "LoadString(...)" definition, it's a macro chosing between :
- LoadStringW for Unicode
- LoadStringA for others # ifdef UNICODE
define LoadString LoadStringW
else
define LoadString LoadStringA
endif // !UNICODE
(libloaderapi.h)
LoadStringW should be used as all of my projects are in unicode but it is actually LoadStringA because it seems like UNICODE is not defined. I'm pretty sure this is why the exception is raised.
How can I force MFC to use UNICODE or where should I define UNICODE to be taken into account by MFC. I tried putting it in "StdAfx.h" without success.