·  MVS 2008 – C++ – Create – Windows Application – MFC

 

- Info:

  - This tutorial shows how to use MVS 2008, C++ amd MFC to create Windows Application.

  - MFC stands for Microsoft Foundation Classes.

  - MFC is collection of C++ classes for creating  Windows Applications.

  - MFC is wrapper around Windows API providing easier development.

  - This tutorial is based on http://www.codeproject.com/KB/cpp/Beginner_MFC_Tutorial.aspx#xx760173xx

 

- Example:

  - Create C++ File Test.cpp

  - RC on MyProject – Properties – Configuration Properties

    - General – Use of MFC: Use MFC in shared DLL

    - Linker – Coommand Line – Additional Options: /SUBSYSTEM:WINDOWS

    - OK

  - Start Without Debugging Ctrl+F5

 

    Test.cpp

    #include <afxwin.h>

    

    //Create Frame Window.

    class MFC_Tutorial_Window :public CFrameWnd { public:

      MFC_Tutorial_Window() { Create(NULL,(LPCTSTR)_T("MFC Tutorial Window")); }

    };

    

    //Create Application with Windows.

    class MyApp :public CWinApp{ public:

      BOOL InitInstance() {

        MFC_Tutorial_Window *wnd = new MFC_Tutorial_Window();

        m_pMainWnd = wnd;

        m_pMainWnd->ShowWindow(1);     

        return 1;

      }

    };

    

    MyApp theApp;