Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 15: Fundamental Controls Visual C++ and MFC Fundamentals



  1. Click Finish

  2. In the same way, Add a CEdit Control Variable for each edit box on the propety
    page and name them, from top to bottom, as m_SquarePerimeter, m_SquareArea,
    m_RectLength, m_RectHeight, m_RectPerimeter, and m_RectArea

  3. Open the Quadrilateral.h file and check that the variables were added:


// Quadrilateral.h : header file
//

#pragma once
#include "afxwin.h"

// CQuadrilateral dialog
class CQuadrilateral : public CPropertyPage
{
// Construction
public:
CQuadrilateral(CWnd* pParent = NULL); // standard constructor

// Dialog Data
enum { IDD = IDD_QUADRILATERAL };

protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support

// Implementation
protected:
HICON m_hIcon;

// Generated message map functions
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
public:
// The control variables for the square
CEdit m_SquareSide;
CEdit m_SquarePerimeter;
CEdit m_SquareArea;
// The control variables for the rectangle
CEdit m_RectLength;
Free download pdf