When I compile this program, a window doesn't open, instead, a message box that says, "Click box.exe has stopped working", I don't know why this is happening.
Here is the WinMain function
Thanks in advancedCode:int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow) { WNDCLASSEX WinClass; MSG msg; LPSTR szClassName = "BoxApp"; //Register the window class WinClass.cbSize = sizeof(WNDCLASSEX); WinClass.style = 0; WinClass.lpfnWndProc = WndProc; WinClass.cbClsExtra = 0; WinClass.cbWndExtra = 0; WinClass.hInstance = g_hInstance; WinClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); WinClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION); WinClass.hCursor = LoadCursor(NULL, IDC_ARROW); WinClass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); WinClass.lpszClassName = szClassName; WinClass.lpszMenuName = NULL; g_hWindow = CreateWindowEx(WS_EX_CLIENTEDGE, szClassName, "The Box App", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 640, 480, NULL, NULL, g_hInstance, NULL); ShowWindow(g_hWindow, iCmdShow); UpdateWindow(g_hWindow); while(1 == 1) { g_pBox->UpdateBox(); InvalidateRect(g_hWindow, NULL, FALSE); if(GetMessage(&msg, NULL, 0, 0) > 0) { TranslateMessage(&msg); DispatchMessage(&msg); } } GameEnd(); }



LinkBack URL
About LinkBacks


