แก้ไข

แชร์ผ่าน


MFC Support in ATL Projects

If you select Support MFC in the ATL Project Wizard, your project declares the application as an MFC application object (class). The project initializes the MFC library and instantiates a class (class ProjName) that is derived from CWinApp.

This option is available for nonattributed ATL DLL projects only.

class CProjNameApp : public CWinApp
{
public:

// Overrides
    virtual BOOL InitInstance();
virtual int ExitInstance();
DECLARE_MESSAGE_MAP()
};

BEGIN_MESSAGE_MAP(CProjNameApp, CWinApp)
END_MESSAGE_MAP()

CProjNameApp theApp;

BOOL CProjNameApp::InitInstance()
{
    return CWinApp::InitInstance();

}

int CProjNameApp::ExitInstance()
{
    return CWinApp::ExitInstance();

}

You can view the application object class and its InitInstance and ExitInstance functions in Class View.

See also

Adding a Class
Creating an ATL Project
Default ATL Project Configurations