I think it is a problem with my compiler (Visual Studio .NET), it says:
fatal error C1010: unexpected end of file while looking for precompiled header directive
and here is my code:
anyone knows what is the problem?Code:#include <windows.h> #include <stdio.h> #define CLASS_NAME "Mi Ventana" LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { HWND hwnd; MSG msg; WNDCLASSEX wndclass; wndclass.cbSize = sizeof (wndclass); wndclass.style = CS_HREDRAW | CS_VREDRAW; wndclass.lpfnWndProc = WndProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = hInstance; wndclass.hIcon = LoadIcon(NULL, IDI_WINLOGO); wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); wndclass.lpszMenuName = NULL; wndclass.lpszClassName = CLASS_NAME; wndclass.hIconSm = LoadIcon(NULL, IDI_WINLOGO); RegisterClassEx(&wndclass); hwnd = CreateWindow(CLASS_NAME, "Ventana 1", WS_OVERLAPPEDWINDOW, 100, 100, 500, 500, NULL, NULL, hInstance, NULL); ShowWindow(hwnd, iCmdShow); UpdateWindow(hwnd); while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } UnregisterClass(CLASS_NAME, hInstance); return msg.wParam; } LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) { switch (iMsg) { case WM_CLOSE: case WM_DESTROY: PostQuitMessage(0); break; } return DefWindowProc(hwnd, iMsg, wParam, lParam); }



LinkBack URL
About LinkBacks


