×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Visual C++2010 MDC application

Visual C++2010 MDC application

Visual C++2010 MDC application

(OP)
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()


 

RE: Visual C++2010 MDC application

Be thorough: CFrameWnd.

C++ identifiers are case-sensitive.
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close