Hey... After numerous checks through the code, I still can't figure out why I'm getting this error: fractal2.cpp(116) : fatal error C1010: unexpected end of file while looking for precompiled header directive
The code is below-- any and all help would be greatly appreciated!
Thanks!!
-maxthecat
#include <windows.h>
#define TIMER_ID 1
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int count = 2;
int cx, cy;
int dir = 0;
int SCALE = 10;
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT("Fractal v2.0");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wndclass.lpszClassName = szAppName;
wndclass.lpszMenuName = NULL;
if (!RegisterClass(&wndclass))
{
MessageBox(NULL, TEXT ("Failed to Register Window"), szAppName, MB_ICONERROR);
return 0;
}
hwnd = CreateWindow(szAppName, TEXT("Fractal Program v2.0"), WS_OVERLAPPEDWINDOW | WS_VSCROLL, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
ShowWindow(hwnd, iCmdShow);
UpdateWindow(hwnd);
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int temp;
switch (message)
{
case WM_CREATE:
SetTimer(hwnd, TIMER_ID, 1000, NULL);
return 0;
case WM_SIZE:
cx = (LOWORD (lParam)) /2;
cy = (HIWORD (lParam)) /2;
InvalidateRect(hwnd, NULL, TRUE);
return 0;
case WM_TIMER:
InvalidateRect(hwnd, NULL, FALSE);
return 0;
case WM_PAINT:
hdc = BeginPaint (hwnd, &ps);
GetClientRect (hwnd, &rc);
hBrush = CreateSolidBrush(RGB(0,0,255));
for (temp=count;temp>0;temp--)
{
switch (dir)
{
case 0:
MoveToEx(hdc, cx, cy, NULL);
LineTo(hdc, cx, (cy + SCALE));
cy += SCALE;
dir++;
break;
case 1:
MoveToEx(hdc, cx, cy, NULL);
LineTo(hdc, (cx - SCALE), cy);
cx -= SCALE:
dir++;
break;
case 2:
MoveToEx(hdc, cx, cy, NULL);
LineTo(hdc, cx, (cy - SCALE));
cy -= SCALE:
dir++;
break;
case 3:
MoveToEx(hdc, cx, cy, NULL);
LineTo(hdc, (cx + SCALE), cy);
cx += SCALE;
dir = 0;
break;
}
}
count = count * count;
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}