I'm wondering why I cannot set the name. This is the error:
It doesn't even let me assign a char.
#include <windows.h>
LRESULT CALLBACK window_callback(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
int WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nShowCmd)
{
//create window class
WNDCLASS window_class = {};
window_class.style = CS_HREDRAW | CS_VREDRAW;
window_class.lpszClassName = "Game Window Class";
window_class.lpfnWndProc = window_callback;//callback
//Register class
//Create window
}

WNDCLASS::lpszClassNameis anLPCTSTRpointer, ie aconst TCHAR*pointer.TCHARmaps towchar_twhenUNICODEis defined, otherwise it maps tocharinstead.You are compiling your project with
UNICODEdefined, becauselpszClassNameis expecting a wideconst wchar_t*pointer to a Unicode string, but you are giving it a (decayed) narrowconst char*pointer to an ANSI string literal instead, hence the error.You can either:
undefine
UNICODEin your project settings.prefix the string literal with
Lto make it a Unicode string:window_class.lpszClassName = L"Game Window Class";wrap the string literal in the
TEXT()macro:window_class.lpszClassName = TEXT("Game Window Class");