void CYourDialog::OnButtonEnterDlgNum(void) { char lpBuffer[256]; m_YourEditCtrl.GetWindowText(lpBuffer, 255); // you could also use this // GetDlgItem(IDC_YOUREDITCTRL)->GetWindowText(lpBuffer, 255); int iMax = atoi(lpBuffer); CEdit *ceEdit; for(int i = 0; i < m_yourint = iMax; i++) { ceEdit = new CEdit; ceEdit.Create(0/* your styles */, CRect(0, 0, 0, 0) /* your rect */, m_YourSecondDlg /* the CWnd object of your 2 dialog */, IDC_ID + i /* your ID (must be unique!)*/); } } hope this helps Я люблю русский язикь!