Visual Studio 2005 Question.

pav

New member
hey everybody.

I'm using VS2005, and when compiling this function :
Code:
WNDCLASSEX WindowClass = {sizeof(WNDCLASSEX), CS_CLASSDC, EntryMessageHandler, 0, 0, GetModuleHandle(NULL),
							  NULL, NULL, NULL, NULL, "Host Application", NULL};

i get this error :
Code:
Error	1	error C2440: 'initializing' : cannot convert from 'const char [17]' to 'LPCWSTR'

if i add a type cast ( (LPCWSTR) ) before the "Host Application", it compiles and runs, but then all of the text on my created window is written in squares ( like this : ▄ ▄ ▄ ▄ ▄ ) instead of letters.


Can i somehow change it back to the way it was in VS2003? where the function would not expect a "LPCWSTR" but a regular "LPSTR"???
 
want to provie the source code/project file so that those interested can play around with what you are talking about? I see this kind of thing all the time but it seems that most of these problems are pretty unique case to case.


k go.
 
You can try adding a capital L right in front of "Host Application" (which makes it wide string) and see what happens.

WNDCLASSEX WindowClass = {sizeof(WNDCLASSEX), CS_CLASSDC, EntryMessageHandler, 0, 0, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, L"Host Application", NULL};
 
adding the L helped :) thank you.

i should really research this issue when i get some free time from work.
 
Back
Top