newbieNadia
Programmer
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!
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:
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()