Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 8th, 2005, 04:37 PM
Authorized User
 
Join Date: Feb 2005
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default beginner-getting end of file w/sample program

Hello, getting the following:

"fatal error C1010: unexpected end of file while looking for precompiled header directive"

when compiling the following code in Visual C++.NET...

#include <afxwin.h>

class CMainFrame : public CFrameWnd
{
public:
    CMainFrame()
    {
        Create(NULL, "Simple Windows Application");
    }
};

class CExerciseApplication: public CWinApp
{
public:
    BOOL InitInstance()
    {
        m_pMainWnd = new CMainFrame;
        m_pMainWnd->ShowWindow(SW_SHOW);
        m_pMainWnd->UpdateWindow();

        return TRUE;
    }
};

CExerciseApplication theApp;

it is sample code- can you help. Thank you. Joe


 
Old March 15th, 2005, 06:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

if It is an MFC project include this line in the beginning

#include "stdafx.h"

When you are creating an MFC project you are expected to add all the elements (class etc)to the project using the wizard only. The wizard adds all the criptic symbology to the files that the class wizard and the compiler looks for if you have compiler settings like "use precompiled headers" ON.


Regards
Ankur Verma





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unexpected end of file while parsing... anup_daware C# 1 February 7th, 2007 05:14 AM
Beginner Question: User Login and Out Program victor888 C# 2005 2 March 10th, 2006 08:21 AM
unexpected end of file Spivonious Visual C++ 2 September 21st, 2004 07:44 AM
unexpected end of file question Spivonious C++ Programming 4 September 15th, 2004 02:24 AM
How to terminate program execution without "End" pavel Beginning VB 6 2 September 2nd, 2003 06:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.