I get this error with this code.
Code:
Code:
char szClassName[] = "CodeBlocksWindowsApp"; //Point of interest
LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain(HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd;
MSG messages;
WNDCLASSEX wincl;
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName; //Error line
Error:
Code:
error C2440: '=' : cannot convert from 'char [21]' to 'LPCWSTR'
I also get an error if I make the point of interest line a LPSTR variable. In visual C++ toolkit 2003 this error does not exist, but in the visual C++ 2005 Express (release, not beta) I get that error. Is there a way to fix this error.
ALSO I get an error if I try to do this:
Code:
hwnd = CreateWindowEx(
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Code::Blocks Template Windows App", //ERROR LINE
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
I get an error (were it says ERROR LINE) saying it can't convert char[number] can not be converted to LPWCSTR. Were in all other compilers I used it worked fine.