Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Visual C++ and MFC Fundamentals Chapter 3: Windows Resources



  1. To save the icon, click the system Close button of the window that is displaying
    the icon

  2. Change the Exercise.cpp file as follows:


#include <afxwin.h>
#include "ResourceDlg.h"

class CResApp: public CWinApp
{
public:
BOOL InitInstance();
};

class CResFrame : public CFrameWnd
{
public:
CResFrame()
{
Create(NULL, "Resources Fundamentals");
}
};

BOOL CResApp::InitInstance()
{
m_pMainWnd = new CResFrame;
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();

return TRUE;
}

CResApp theApp;


  1. Test the application:

Free download pdf