Using and understanding Unicode
According to MSDN, Microsoft recommends that all new programs be Unicode.
I am running Visual Studio 2005 SP1 and all of you know that the 2005 compiler defaults to Unicode. The code below compiles when I change to Multi-Byte character set, but won't compile under Unicode due to the conversion compiler error. But how then do you write an Unicode program?
As I understand it there is actaully two functions for each function that uses strings. A for ANSI and W for Unicode. If I understand correctly the compiler will select the appropriate function depending on how you compile the code. So if my understanding is correct, how come the compiler doesn't use the W function when Unicode is selected in the project's properties? Do I need to include or define something? Or perhaps change something in my code?
So in short my question is how do I write native Unicode programs?
Here is the code that compiles correctly under the Multi-Byte setting:
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd)
{
MessageBox(NULL,
"The Message",
"The Title",
MB_OK | MB_ICONINFORMATION);
return 0;
}

