I'm a complete newbie to VC++ .NET, and I wanted to learn MFC programming so I am now looking at the book "MFC Programming from the Ground Up". Unfortunately, this book was written for VC++6, and I immediately hit a roadblock when I tried the first sample.

Here's the code.

#include <afxwin.h>

// Derive essential classes.

// This is the main window class.
class CMainWin : public CFrameWnd

// Construct a window.
    Create(NULL, "An MFC Application Skeleton");

// This is the application class.
class CApp : public CWinApp
    BOOL InitInstance();

// Initialize the application.
BOOL CApp::InitInstance()
    m_pMainWnd = new CMainWin;

    return TRUE;

// This is the application's message map.

CApp App; // instantiate the application

Besides typing in the code, I also went into the project settings and set it to "Use MFC in a shared DLL."

When I build it, I get the following error message:
"bare_bones fatal error LNK1561: entry point must be defined"

I guess the above code works fine in VC++6, or else the book wouldn't have gotten such good reviews.

I'm just wondering, what do I have to do to make it work in .NET?

Just in case you need to know, I tried the following project settings:

First, I chose "Empty Project (.NET)".

Since that didn't work, I also tried Win32 Project (Console), with the options set as follows:
Application Type: Console Application.
Add support for MFC.
Additional Options: Empty Project (Unchecked), Precompiled Header (Unchecked).

Finally, I tried "MFC Application", then deleted all header, source, and resource files and added a new source file and pasted the code in there.

None of the above worked.