I've recently bought Programming Windows with MFC by Jeff Prosise, and I must say, it is a great book so far, but when I went to compile the sample source in MSVC++.NET, it would not compile. I've tried everything - I've created Win32 projects, MFC application projects, but nothing seems to work. I'm just wondering if there's a way to get the win32 projects to recognize MFC as an option when I'm configuring the project because when win32 is selected, the MFC option is blanked out.
I'm trying to compile the first "hello world" app, but with no avail. Here's the source in case anyone asks
class CMyApp : public CWinApp
virtual BOOL InitInstance ();
class CMainWindow : public CFrameWnd
afx_msg void OnPaint ();
In the win32 project, whenever I compile, I get three errors, those being:
// CMyApp member functions
BOOL CMyApp::InitInstance ()
m_pMainWnd = new CMainWindow;
// CMainWindow message map and member functions
BEGIN_MESSAGE_MAP (CMainWindow, CFrameWnd)
Create (NULL, _T ("The Hello Application"));
void CMainWindow::OnPaint ()
CPaintDC dc (this);
dc.DrawText (_T ("Hello, MFC"), -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
helloworld error LNK2019: unresolved external symbol __endthreadex referenced in function "void __stdcall AfxEndThread(unsigned int,int)" (?AfxEndThread@@YGXIH@Z)
helloworld error LNK2019: unresolved external symbol __beginthreadex referenced in function "public: int __thiscall CWinThread::CreateThread(unsigned long,unsigned int,struct _SECURITY_ATTRIBUTES *)" (?CreateThread@CWinThread@@QAEHKIPAU_SECURITY_ATTRIBUTES@@@Z)
I'm totally clueless about these errors. I admit, when it comes to windows programming, I'm a complete newbie. There's no two ways around it.
helloworld fatal error LNK1120: 2 unresolved externals
Any help is greatly appreciated, and more than welcome.