Problem with sample from msdn; Simple WinAPI program

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi guys!
I have the next problem:
Compiler cannot convert parameter 3 from const char [24] to LPCWSTR.

<div style="color:black; background-color:white
<pre>hwnd = CreateWindowEx (
0,
LPCWSTR)szClassName,
<span style="color:#a31515 "MyFirstProgram v1.0.0.0",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
230,
75,
HWND_DESKTOP,
NULL,
hThisInstance,
NULL
);
[/code]


If I use explicit conversion like: (LPCWSTR)"MyFirstProgram v1.0.0.0" - I will get the next error: error LNK2019: unresolved external symbol "long __stdcall WindowProcedure.

I know, that such error occurs if I use CONSOLE type of macroses for compiler.
But, I use "_WINDOWS" in preprocessor and "subsystem:windows" in linker.

Why I have got such error?

Thanks,
Best Regards,
Oleg
<br/>

View the full article
 
Back
Top