Here an example for an array of 2 buttons.
In the header declare:
Code:
typedef CButton CMyButton[2];
and use it in AFX_DATA
Code:
//{{AFX_DATA(CGeneralTestDlgDlg)
enum { IDD = IDD_GENERALTESTDLG_DIALOG };
CMyButton m_button;
//}}AFX_DATA
In the source file write the DoDataExchange like this:
Code:
void CGeneralTestDlgDlg::DoDataExchange(CDataExchange* pDX)
{
CButton &but1 = m_button[0];
CButton &but2 = m_button[1];
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CGeneralTestDlgDlg)
DDX_Control(pDX, IDC_BUTTON2, but1);
DDX_Control(pDX, IDC_BUTTON1, but2);
//}}AFX_DATA_MAP
}
Now you will be able to use the class wizzard and have buttons array.
Bookmarks