000
16.04.2005, 18:55 Uhr
Sascha81
|
1 Fehler ( = ) winclass.lpszClassName = WINDOW_CLASS_NAME;
WENN ich winclass.lpszClassName = WINDOW_CLASS_NAME; und #define WINDOW_CLASS_NAME = "Game Shell Window" WEGNEHME habe ich keine Fehler und Warnung!!!!!
Aber nach dem ich es ausführe (die exe) kommt eine Fehlermeldung und geht in den DEBUG in Assembler über wo ich eh nicht sehr viel verstehe!
BITTE UM HILFE
C++: |
//------------------------------------------------------------------------------ // DEFINES //------------------------------------------------------------------------------ #define WINDOW_CLASS_NAME = "Game Shell Window" #define WIN32_LEAN_AND_MEAN //------------------------------------------------------------------------------ // INCLUDES //------------------------------------------------------------------------------ #include <windows.h> //------------------------------------------------------------------------------ // MAKROS //------------------------------------------------------------------------------ #define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code)&0x8000)?1:0) #define KEYUP(vk_code) ((GetAsyncKeyState(vk_code)&0x8000)?0:1) //------------------------------------------------------------------------------ // GLOBALS //------------------------------------------------------------------------------ HWND main_window_handle = NULL; HINSTANCE hinstance_app = NULL; //------------------------------------------------------------------------------ // Wichtige GAME - Funktionsprototypen //------------------------------------------------------------------------------ void Game_Shutdown(void); void Game_Init(void); void Game_Main(void); //------------------------------------------------------------------------------ // Funktionsdefinitionen //------------------------------------------------------------------------------ LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { PAINTSTRUCT ps; HDC hdc;
// Nachrichtenverarbeitung switch(msg) { case WM_CREATE: { return(0); } break; case WM_PAINT: { hdc = BeginPaint(hwnd, &ps); EndPaint(hwnd, &ps); return(0); } break; case WM_DESTROY: { PostQuitMessage(0); return(0); } break; default: break; } return (DefWindowProc(hwnd, msg, wparam, lparam)); }
///////////////////////////////////////////////////////////////////////////
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int ShowCmd) { WNDCLASSEX winclass; HWND hwnd; MSG msg;
// Fenstereigenschaften festlegen: winclass.cbSize = sizeof(WNDCLASSEX); winclass.style = CS_HREDRAW | CS_VREDRAW; winclass.lpfnWndProc = WindowProc; winclass.cbClsExtra = 0; winclass.cbWndExtra = 0; winclass.hInstance = hInstance; winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); winclass.hCursor = LoadCursor(NULL, IDC_ARROW); winclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); winclass.lpszClassName = WINDOW_CLASS_NAME; winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
hinstance_app = hInstance;
if(!RegisterClassEx(&winclass)) return(0);
if(!(hwnd = CreateWindowEx(NULL, WINDOW_CLASS_NAME, "My Game Shell", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 800, 600, NULL, NULL, hInstance, NULL)))
return(0); main_window_handle = hwnd;
Game_Init();
while(TRUE) // Nachrichtenverarbeitung { if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if(msg.message == WM_QUIT) break;
TranslateMessage(&msg); DispatchMessage(&msg); }
Game_Main(); }
Game_Shutdown();
return(msg.wParam); }
///////////////////////////////////////////////////////////////////////////
void Game_Main(void) { if(KEYDOWN(VK_ESCAPE)) SendMessage(main_window_handle, WM_CLOSE, 0, 0); }
///////////////////////////////////////////////////////////////////////////
void Game_Shutdown(void) {}
void Game_Init(void) {}
|
Dieser Post wurde am 16.04.2005 um 19:00 Uhr von Sascha81 editiert. |