Jump to content
  • Advertisement
Sign in to follow this  
Fixxer

Unexpected End Of File Found

This topic is 4776 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im getting this error from this code.
#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <windowsx.h>
#include <stdio.h>
#include <math.h>

///////////////////////////////////////////////////////////////////////
// Events Handler
//////////////////////////
// This section will handle windows events
///////////////////////////////////////////////////////////////////////
LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
PAINTSTRUCT ps;
HDC hdc;
switch(msg){
case WM_CREATE:
	{
		return(0);
	}
case WM_PAINT:
	{
		hdc = BeginPaint(hwnd,&ps);
		EndPaint(hwnd,&ps);
		return(0);
	}
case WM_DESTROY:
	{
		PostQuitMessage(0);
		return(0);
	} break;
default:break;
}
return(DefWindowProc(hwnd,msg,wparam,lparam));
}

///////////////////////////////////////////////////////////////////////
// Window main 
//////////////////////////
// This section is where the main program code goes.
///////////////////////////////////////////////////////////////////////

int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow)
{
///////////////////////////////////////////////////////////////////////
// Windows Class
//////////////////////////
// This section sets up the windows class structure.
// This section creates the application, and determines its
// properties.
///////////////////////////////////////////////////////////////////////
WNDCLASSEX winclass;
HWND hwnd;
MSG msg;
winclass.cbSize = sizeof(WNDCLASSEX);
winclass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC | CS_DBLCLKS;
winclass.lpfnWndProc = WindowProc;
winclass.cbClsExtra = 0;
winclass.cbWndExtra = 0;
winclass.hInstance = hinstance;
winclass.hIcon = LoadIcon(NULL,IDI_WINLOGO);
winclass.hCursor = LoadCursor(NULL,IDC_ARROW);
winclass.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
winclass.lpszMenuName = NULL;
winclass.lpszClassName = "WINCLASS1";
winclass.hIconSm = LoadIcon(NULL,IDI_WINLOGO);
if(!RegisterClassEx(&winclass))
return(0);
///////////////////////////////////////////////////////////////////////
// Create Window
//////////////////////////
// This section will create our window.
///////////////////////////////////////////////////////////////////////
if(!(hwnd = CreateWindowEx(NULL,"WINCLASS1","Lightning Round: Please Log In",
   WS_OVERLAPPEDWINDOW | WS_VISIBLE,100,75,400,300,NULL,NULL,
   hinstance, NULL)))
   return(0);
///////////////////////////////////////////////////////////////////////
// Main Event Loop
//////////////////////////
// This section will create our window.
///////////////////////////////////////////////////////////////////////
while(TRUE)
{
	if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
	{
		if(msg.message == WM_QUIT){
			break;
		}
		TranslateMessage(&msg);
		DispatchMessage(&msg);
}
return(msg.wParam);
}


Share this post


Link to post
Share on other sites
Advertisement
If your project is set up to use precompiled headers, you need to include "stdafx.h" (and make sure it exists) as the first thing in your program.

Otherwise, count the braces and make sure they match.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!