CPenWidthsDlg dlg; // Initialize dialog data dlg.m_nThinWidth = m_nThinWidth; dlg.m_nThickWidth = m_nThickWidth; // Invoke the dialog box if (dlg.DoModal() == IDOK) { // retrieve the dialog data m_nThinWidth = dlg.m_nThinWidth; m_nThickWidth = dlg.m_nThickWidth; // Update the pen used by views when drawing new strokes // to reflect the new pen widths for "thick" and "thin". ReplacePen(); }