Original Post
I am in the middle of writing an application, and have run into problems when trying to convert a const char* variable into an LPCWSTR type variable. Why convert? 1. CreateWindowEx(), which I use to create my application window with, takes only LPCWSTR type parameters for the window title/caption, so I simply do a type conversion (i.e. (LPCWSTR)windowTitle) on my parameter which is initially a const char*. 2. TextOut(), which I use to print text (I know it is supposed to be slow, but I am using it sparingly so do not worry about that), uses an LPCWSTR for the text that is to be printed, so I have a make a similar type conversion there as well. Now, converting from a const char* into an LPCWSTR makes the text appear garbled. Is there any way to solve this? I remember that it worked prior to acquiring Visual Studio 2005, when those functions accepted LPCSTR instead of the "wide char" (apparently unicode) LPCWSTR.