• Advertisement
Sign in to follow this  

Compiler Problem

This topic is 4343 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I just downloaded Visual C++ 2005 Express Edition and I'm trying to learn MFC, but I seem to be having a problem with my compiler. I keep getting this error message: fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory Here is the code. What's wrong? // MFC Test3.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <afxwin.h> //hello.cpp // Declare the application class class CHelloApp : public CWinApp { public: virtual BOOL InitInstance(); }; // Create an instance of the application class CHelloApp HelloApp; // Declare the main window class class CHelloWindow : public CFrameWnd { CStatic* cs; public: CHelloWindow(); }; // The InitInstance function is called each // time the application first executes. BOOL CHelloApp::InitInstance() { m_pMainWnd = new CHelloWindow(); m_pMainWnd->ShowWindow(m_nCmdShow); m_pMainWnd->UpdateWindow(); return TRUE; } // The constructor for the window class CHelloWindow::CHelloWindow() { // Create the window itself Create(NULL, "Hello World!", WS_OVERLAPPEDWINDOW, CRect(0,0,200,200)); // Create a static label cs = new CStatic(); cs->Create("hello world", WS_CHILD|WS_VISIBLE|SS_CENTER, CRect(50,80,150,150), this); }

Share this post


Link to post
Share on other sites
Advertisement
Visual C++ Express Edition doesn't include MFC, so you won't get very far with MFC programming. As an alternative, have a look at the .NET Framework, which is included.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement