liben
August 8th, 1999, 01:13 AM
I wrote a dialog based app with Visual C++ 6.0.In CAboutDlg class, I use Resource Editor to add a CSpinButtonCtrl control.It's ID is ID_SPIN1.In ClassWizard,I attach a Member Variable to it.The variable's type is CSpinButtonCtrl and it's name is m_spin1.I wrote the code:
CAboutDlg aboutdlg;
aboutdlg.m_spin1.SetRange(1,31);//cause assertion failure
aboutdlg.DoModal();
I can complied it with no error.But when I run these code,any member function of CSpinButtonCtrl will cause assertion failure.Perhaps put these code in aboutdlg.OnInitDialog member function will not cause error,but I can't.Because I must set and get the CSpinButtonCtrl control's data in a generic class.Please help me!
CAboutDlg aboutdlg;
aboutdlg.m_spin1.SetRange(1,31);//cause assertion failure
aboutdlg.DoModal();
I can complied it with no error.But when I run these code,any member function of CSpinButtonCtrl will cause assertion failure.Perhaps put these code in aboutdlg.OnInitDialog member function will not cause error,but I can't.Because I must set and get the CSpinButtonCtrl control's data in a generic class.Please help me!