I am relatively new to C++ and am currently taking a course for it. One of my assignments is to make a calculator for hourly wages and figure gross and net pay based on a fixed percentage for taxes.
I am able to compile the code if I change the default character set from unicode to not used, but my professor is saying I have bad code. While it does compile with unicode turned off, I still get runtime errors that can be ignored during program execution. Also, if I use the same code in dev-C++ I do not have any issues.
I am using Visual Studio 2008 and have gone over the syntax with my book for hours and hours with the same results. I am getting errors while converting from const to char[x] to LPCWSTR. Any help, or even an explanation of the errors would be greatly appreciated!
LINE 2 error C2440: '=' : cannot convert from 'const char ' to 'LPCWSTR'
WNDCLASS wc; wc.lpszClassName = "PayClass";
LINE 12 error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char ' to 'LPCWSTR'
hWnd = CreateWindow( "PayClass", "Pay", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 230, 190, NULL, NULL, hInstance, NULL);
Edited 7 Years Ago by aszopinski: Added details