Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual C++2010 MDC application

Status
Not open for further replies.

newbieNadia

Programmer
Dec 5, 2010
1
0
0
CA
Hi all,
I found a tutorial for creating MFC applications and I'm trying it out but I keep getting error messages that I don't know what to do with. please help!

Code:
// header File Airport.h
#pragma once
class CMainWin : public CFrameWnd
{
public:
CMainWin();
DECLARE_MESSAGE_MAP()
};

class CApp : public CWinApp
{
public:
BOOL InitInstance();
};

// Application File Airport.cpp
#include "StdAfx.h"
#include <afxwin.h>
#include "Airport.h"

#pragma once

CMainWin::CMainWin()
{
	Create(NULL, TEXT("My MFC Application"));
}

BOOL CApp::InitInstance()
{
	try
	{
		m_pMainWnd = new CMainWin;
		m_pMainWnd->ShowWindow(m_nCmdShow);
		m_pMainWnd->UpdateWindow();
		return TRUE;
	}
	catch(...)
	{
		return FALSE;
	}
}

BEGIN_MESSAGE_MAP(CMainWin, CframeWnd)
END_MESSAGE_MAP()

CApp App;

These are the errors I get:

error C2146: syntax error : missing ';' before identifier 'TheBaseClass'

error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

error C2065: 'TheBaseClass' : undeclared identifier

error C2653: 'TheBaseClass' : is not a class or namespace name

The program just doesn't seem to be able to process these two lines:

Code:
BEGIN_MESSAGE_MAP(CMainWin, CframeWnd)
END_MESSAGE_MAP()


 
Be thorough: CFrameWnd.

C++ identifiers are case-sensitive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top