Hi,
I have a strange problem in our application.
We are doing some process in function, it is taking some time to complete it.
So we are showing one modal dialog without any button..which will diappear by itself in some timer as we have put timer in its constructor.
things are working fine in debug mode...but in release mode application is crashing on
obj.Domodal() statement.
insead of this statement , if we put AfxMessageBox containing 'OK' button, then application is working fine.
Please help me on this...i have stuck badly...
Below is code where program crashes...
evtHandler->SystemObject_SystemStartup(pszCDM_serviceName, pszCIM_serviceName, m_TellerNumber ,m_iOpenTimeout); ::Sleep(5000); //AfxMessageBox("Connecting to Device..."); obj.DoModal(); // crash after this call...Code of Dialog box is given below....
CTalarisProgressBar::CTalarisProgressBar(CWnd* pParent /*=NULL*/) : CDialog(CTalarisProgressBar::IDD, pParent) { //{{AFX_DATA_INIT(CTalarisProgressBar) m_strCaptionText = _T("Connecting To Device In Progress..."); m_nSleep = 5000; //}}AFX_DATA_INIT } void CTalarisProgressBar::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CTalarisProgressBar) DDX_Text(pDX, IDC_STATIC_SET, m_strCaptionText); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CTalarisProgressBar, CDialog) //{{AFX_MSG_MAP(CTalarisProgressBar) ON_WM_TIMER() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CTalarisProgressBar message handlers BOOL CTalarisProgressBar::OnInitDialog() { SetTimer(1, m_nSleep, NULL); CDialog::OnInitDialog(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CTalarisProgressBar::OnTimer(UINT_PTR nIDEvent) { // TODO: Add your message handler code here and/or call default KillTimer(100); ::PostMessage(this->m_hWnd, WM_CLOSE, 0, 0); CDialog::OnTimer(nIDEvent); } void CTalarisProgressBar::SetWaitingTime(int timerCount) { m_nSleep = timerCount; } void CTalarisProgressBar::SetDialogCaption(CString strCaption) { m_strCaptionText = strCaption; }
Here is callstack...
FParentTab::CustomTranslateAccelerator(FParentTab * const 0x00000000 {FParentTab hWnd=???}, tagMSG * 0x005b6594 {msg=0x00000104 wp=0x00000012 lp=0x20380001}) line 361 + 9 bytes CMainFrame::CustomTranslateAccelerator(CMainFrame * const 0x00000000 {CMainFrame hWnd=???}, tagMSG * 0x00417f2b {msg=0xe8cf8b56 wp=0x00106d85 lp=0x04c25e5f}) line 559 + 12 bytes CCootsApp::PreTranslateMessage(CCootsApp * const 0x00000000 {CCootsApp ???}, tagMSG * 0x005b6594 {msg=0x00000104 wp=0x00000012 lp=0x20380001}) line 735 MFC42! 730d5436() MFC42! 73101aca() CCashDispenser::OpenServices(CCashDispenser * const 0x00000000) line 201 + 15 bytes