ok. Now, I changed my main message handling loop to a PeekMessage and it compiles ok but I get the following Linker error:
cannot open Debug/cPong.exe for writing
Error executing link.exe.
WTH??!!
(source included below)
#include "declare.h"#include <windows.h>///////////////////////////////////LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam){ PAINTSTRUCT ps; HDC hdc; 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: { return (DefWindowProc(hwnd, msg, wparam, lparam)); } }}int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int nshowcmd){ HWND hwnd; MSG msg; WNDCLASSEX winclass = { winclass.cbSize = sizeof(WNDCLASSEX), CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW, WindowProc, 0, 0, hinstance, LoadIcon(NULL, IDI_APPLICATION), LoadCursor(NULL, IDC_ARROW), (HBRUSH)GetStockObject(BLACK_BRUSH), NULL, "WINCLASS1", LoadIcon(NULL, IDI_APPLICATION) }; if (!RegisterClassEx(&winclass)) return(0); if (!(hwnd = CreateWindowEx(NULL, "WINCLASS1", "cPong", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0,0, SCREENWIDTH, SCREENHEIGHT, NULL, NULL, hinstance, NULL))) return(0); while(TRUE) { if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) { if(msg.message == WM_QUIT) { break; } TranslateMessage(&msg); DispatchMessage(&msg); } } return(msg.wParam); }
Charles Hwang -Also/Previously known as Tazel
Personal >>[MonkeyHumor-Under Developement | E-mail]
Programming >>[NeXe|NeHe|SDL]
Resource >>[Google|Dev-C++|GDArticles|C++.com|MSDN]