dialog on cancel run time error : Run-Time Check Failure #2 - Stack around the variable xxx...

  • Thread starter Thread starter kobosh
  • Start date Start date
K

kobosh

Guest
Hi I have mfc mdi application;

I have a dialog schedDlg which invoked from a parent window TignSetup

like this : schedDlg evtDlg(0,1); evtDlg.domodal();

the dialog shows up and everything is ok;

however when I click cancel button on the dialog i get run time error:Run-Time Check Failure #2 - Stack around the variable evtDlg was corrupted.

my guessing is that because schedDlg does not provide a desctructor the oncancel method fails

but as i see it the constructor does not allocate any memory which is needed to be released

CScheduleEventDlg::CScheduleEventDlg(int rows, int enableServiceScroll, CWnd* pParent /*=NULL*/)
: CDialog(CScheduleEventDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CScheduleEventDlg)
m_currState = "";//NULL;//_T("");
m_effFromDay = 0;
m_effFromMonth = 0;
m_effFromYear = 0;
m_effToDay = 0;
m_effToMonth = 0;
m_effToYear = 0;
m_excFromHour = 0;
m_excToHour = 0;
m_friday = FALSE;
m_monday = FALSE;
m_saturday = FALSE;
m_sunday = FALSE;//
m_thursday = FALSE;
m_tuesday = FALSE;
m_frequency = -1;
m_wednesday = FALSE;
m_intervalHour = 0;
m_runTimeHour = 0;
m_runTimeMin = 0;//
m_suspend = FALSE;
m_type = -1;
m_excFromMin = 0;//
m_excToMin = 0;
m_intervalMin = 0;
//}}AFX_DATA_INIT
m_rows = rows;
m_enableServiceScroll = enableServiceScroll;
m_initFromGlobalSetup = 0;

}







I am skeptic about the first item m_currState="";

Any suggestions how to fix the problem will be appreciated

Continue reading...
 
Back
Top