0xC000001D "Fatal Application Error" ????
-
Hello, In eVC++ with WinCE5 on ARMV4I, the application is developed. In my Property Sheet, in a page, on a button click the program executes the following code.
void CPPage1::GetData() {
bool result = true; // CONVERT STRING TO INT CString csValue; GetDlgItem(IDC\_OpNo\_EDIT)->GetWindowText( csValue ); m\_opNo = atoi((char\*)(LPCTSTR)csValue); csValue.Format(\_T("%d"), m\_opNo); AfxMessageBox(csValue); // Search operator no OperatorDetails od; od = g\_db->GetOperDetails(m\_opNo); CString s(\_T("Map Count = ")); s.Format(\_T("%s %d \\n %s %s"), s, g\_db->GetOperMapCount(), \_T("Page1::Got OD"), od.GetOperName()); AfxMessageBox(s); if (od.GetOperatorNo() == 0 && od.GetOperName() == "") { AfxMessageBox(\_T("Operator No Not found. Check Out!"),MB\_ICONWARNING); result = false; } else if (od.GetOperName() == "") { AfxMessageBox(\_T("Error Reading Data!"),MB\_ICONWARNING); result = false; }else { CString nm = od.GetOperName(); m\_name = nm; GetDlgItem(IDC\_NAME\_LABEL)->SetWindowText(nm); AfxMessageBox(nm); EnableConfirm(true); } if (result == false) { m\_opNo = 0; GetDlgItem(IDC\_OpNo\_EDIT)->SetWindowText(\_T("")); GetDlgItem(IDC\_OpNo\_EDIT)->SetFocus(); } return;
}
g_db is an extern variable pointer to an object. I don't get any compiler/liner etc error or warnings. OnApply is called, everything is executed & then I get "Fatal Application Error" window saying application has performed an illegal operation & will be shut down. If problem continues contact vendor. Exception: 0xC000001D Address: 0050328. If I avoid the above code, then I don't get this exception. Since it is a WincE with eVC application, I can't debug more to know where & what excatly the error line is. Can anyone help me know, what is illegal in the above code which happens to raise this exception.
Thanks Terry
-
Hello, In eVC++ with WinCE5 on ARMV4I, the application is developed. In my Property Sheet, in a page, on a button click the program executes the following code.
void CPPage1::GetData() {
bool result = true; // CONVERT STRING TO INT CString csValue; GetDlgItem(IDC\_OpNo\_EDIT)->GetWindowText( csValue ); m\_opNo = atoi((char\*)(LPCTSTR)csValue); csValue.Format(\_T("%d"), m\_opNo); AfxMessageBox(csValue); // Search operator no OperatorDetails od; od = g\_db->GetOperDetails(m\_opNo); CString s(\_T("Map Count = ")); s.Format(\_T("%s %d \\n %s %s"), s, g\_db->GetOperMapCount(), \_T("Page1::Got OD"), od.GetOperName()); AfxMessageBox(s); if (od.GetOperatorNo() == 0 && od.GetOperName() == "") { AfxMessageBox(\_T("Operator No Not found. Check Out!"),MB\_ICONWARNING); result = false; } else if (od.GetOperName() == "") { AfxMessageBox(\_T("Error Reading Data!"),MB\_ICONWARNING); result = false; }else { CString nm = od.GetOperName(); m\_name = nm; GetDlgItem(IDC\_NAME\_LABEL)->SetWindowText(nm); AfxMessageBox(nm); EnableConfirm(true); } if (result == false) { m\_opNo = 0; GetDlgItem(IDC\_OpNo\_EDIT)->SetWindowText(\_T("")); GetDlgItem(IDC\_OpNo\_EDIT)->SetFocus(); } return;
}
g_db is an extern variable pointer to an object. I don't get any compiler/liner etc error or warnings. OnApply is called, everything is executed & then I get "Fatal Application Error" window saying application has performed an illegal operation & will be shut down. If problem continues contact vendor. Exception: 0xC000001D Address: 0050328. If I avoid the above code, then I don't get this exception. Since it is a WincE with eVC application, I can't debug more to know where & what excatly the error line is. Can anyone help me know, what is illegal in the above code which happens to raise this exception.
Thanks Terry
Trupti Mehta wrote:
Since it is a WincE with eVC application, I can't debug more to know where & what excatly the error line is.
No, I don't quite get it. Can't you use ActiveSync and debug the application straight from your IDE? You could as well use simple message boxes or a log file to analyze at what point the application terminates.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
-
Hello, In eVC++ with WinCE5 on ARMV4I, the application is developed. In my Property Sheet, in a page, on a button click the program executes the following code.
void CPPage1::GetData() {
bool result = true; // CONVERT STRING TO INT CString csValue; GetDlgItem(IDC\_OpNo\_EDIT)->GetWindowText( csValue ); m\_opNo = atoi((char\*)(LPCTSTR)csValue); csValue.Format(\_T("%d"), m\_opNo); AfxMessageBox(csValue); // Search operator no OperatorDetails od; od = g\_db->GetOperDetails(m\_opNo); CString s(\_T("Map Count = ")); s.Format(\_T("%s %d \\n %s %s"), s, g\_db->GetOperMapCount(), \_T("Page1::Got OD"), od.GetOperName()); AfxMessageBox(s); if (od.GetOperatorNo() == 0 && od.GetOperName() == "") { AfxMessageBox(\_T("Operator No Not found. Check Out!"),MB\_ICONWARNING); result = false; } else if (od.GetOperName() == "") { AfxMessageBox(\_T("Error Reading Data!"),MB\_ICONWARNING); result = false; }else { CString nm = od.GetOperName(); m\_name = nm; GetDlgItem(IDC\_NAME\_LABEL)->SetWindowText(nm); AfxMessageBox(nm); EnableConfirm(true); } if (result == false) { m\_opNo = 0; GetDlgItem(IDC\_OpNo\_EDIT)->SetWindowText(\_T("")); GetDlgItem(IDC\_OpNo\_EDIT)->SetFocus(); } return;
}
g_db is an extern variable pointer to an object. I don't get any compiler/liner etc error or warnings. OnApply is called, everything is executed & then I get "Fatal Application Error" window saying application has performed an illegal operation & will be shut down. If problem continues contact vendor. Exception: 0xC000001D Address: 0050328. If I avoid the above code, then I don't get this exception. Since it is a WincE with eVC application, I can't debug more to know where & what excatly the error line is. Can anyone help me know, what is illegal in the above code which happens to raise this exception.
Thanks Terry
Trupti Mehta wrote:
...then I get "Fatal Application Error" window saying application has performed an illegal operation & will be shut down.
Before or after the calls to
AfxMessageBox()
?"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Hello, In eVC++ with WinCE5 on ARMV4I, the application is developed. In my Property Sheet, in a page, on a button click the program executes the following code.
void CPPage1::GetData() {
bool result = true; // CONVERT STRING TO INT CString csValue; GetDlgItem(IDC\_OpNo\_EDIT)->GetWindowText( csValue ); m\_opNo = atoi((char\*)(LPCTSTR)csValue); csValue.Format(\_T("%d"), m\_opNo); AfxMessageBox(csValue); // Search operator no OperatorDetails od; od = g\_db->GetOperDetails(m\_opNo); CString s(\_T("Map Count = ")); s.Format(\_T("%s %d \\n %s %s"), s, g\_db->GetOperMapCount(), \_T("Page1::Got OD"), od.GetOperName()); AfxMessageBox(s); if (od.GetOperatorNo() == 0 && od.GetOperName() == "") { AfxMessageBox(\_T("Operator No Not found. Check Out!"),MB\_ICONWARNING); result = false; } else if (od.GetOperName() == "") { AfxMessageBox(\_T("Error Reading Data!"),MB\_ICONWARNING); result = false; }else { CString nm = od.GetOperName(); m\_name = nm; GetDlgItem(IDC\_NAME\_LABEL)->SetWindowText(nm); AfxMessageBox(nm); EnableConfirm(true); } if (result == false) { m\_opNo = 0; GetDlgItem(IDC\_OpNo\_EDIT)->SetWindowText(\_T("")); GetDlgItem(IDC\_OpNo\_EDIT)->SetFocus(); } return;
}
g_db is an extern variable pointer to an object. I don't get any compiler/liner etc error or warnings. OnApply is called, everything is executed & then I get "Fatal Application Error" window saying application has performed an illegal operation & will be shut down. If problem continues contact vendor. Exception: 0xC000001D Address: 0050328. If I avoid the above code, then I don't get this exception. Since it is a WincE with eVC application, I can't debug more to know where & what excatly the error line is. Can anyone help me know, what is illegal in the above code which happens to raise this exception.
Thanks Terry
I believe WinCE5 uses Unicode, and you have MOST of your code set for that (by using the _T macro). However, this line
Trupti Mehta wrote:
m_opNo = atoi((char*)(LPCTSTR)csValue);
is not Unicode. Use
m_opNo = _tstoi((LPCSTSTR)csValue);
instead. Hope that helps.
Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
-
I believe WinCE5 uses Unicode, and you have MOST of your code set for that (by using the _T macro). However, this line
Trupti Mehta wrote:
m_opNo = atoi((char*)(LPCTSTR)csValue);
is not Unicode. Use
m_opNo = _tstoi((LPCSTSTR)csValue);
instead. Hope that helps.
Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
krmed wrote:
is not Unicode. Use m_opNo = _tstoi((LPCSTSTR)csValue);
Or even better use no explicit cast:
m_opNo = _tstoi(csValue);
Steve
-
Trupti Mehta wrote:
Since it is a WincE with eVC application, I can't debug more to know where & what excatly the error line is.
No, I don't quite get it. Can't you use ActiveSync and debug the application straight from your IDE? You could as well use simple message boxes or a log file to analyze at what point the application terminates.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP
Rajesh, I use eVC++ & run the application via ActieSync. But I believe that I cannot debug in this scenario. Like On Abort/Retry/Ignore, press Retry & the debugger will come on the error line. No that's not possible. What all AfxMessageBox, you see all are for debugging purpose only mainly.
Thanks Terry
-
Trupti Mehta wrote:
...then I get "Fatal Application Error" window saying application has performed an illegal operation & will be shut down.
Before or after the calls to
AfxMessageBox()
?"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
BOOL CPPage1::OnApply()
{
// TODO: Add your specialized code here and/or call the base class
AfxMessageBox(_T("CPPage1:: OnApply\n"));g\_pView->SendMessage(WM\_USERAPPLY); return TRUE; //CPropertyPage::OnApply();
}
LRESULT CMC_AppView::OnUserApply(WPARAM wParam, LPARAM lParam)
{
TRACE(_T("VIEW::OnUserApply - wParam %x\n"), wParam);
CString t("Operator No = ");
AfxMessageBox(t); // m_sheet.m_page1.m_opNo);
// m_sheet.SetAttributes();
m_sheet.EndDialog(IDOK);
return 0;
}OnApply calls the OnUserApply. I get the "Operator No = " AfxMessage & then the fatal error comes. Thanks Terry
-
BOOL CPPage1::OnApply()
{
// TODO: Add your specialized code here and/or call the base class
AfxMessageBox(_T("CPPage1:: OnApply\n"));g\_pView->SendMessage(WM\_USERAPPLY); return TRUE; //CPropertyPage::OnApply();
}
LRESULT CMC_AppView::OnUserApply(WPARAM wParam, LPARAM lParam)
{
TRACE(_T("VIEW::OnUserApply - wParam %x\n"), wParam);
CString t("Operator No = ");
AfxMessageBox(t); // m_sheet.m_page1.m_opNo);
// m_sheet.SetAttributes();
m_sheet.EndDialog(IDOK);
return 0;
}OnApply calls the OnUserApply. I get the "Operator No = " AfxMessage & then the fatal error comes. Thanks Terry
Trupti Mehta wrote:
AfxMessageBox(t); m_sheet.EndDialog(IDOK);
What happens if you remove either of these two statements?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Trupti Mehta wrote:
AfxMessageBox(t); m_sheet.EndDialog(IDOK);
What happens if you remove either of these two statements?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
Afx.. was from first. Error is coming from the code attached in first message & in the mean while had also added EndDialog. Will try removing EndDialog & check out next week. On research I have known that this exception stands if soething is not closed properly. Do you see any other possibility in the attached code or eVC has any internal problem accessing an more than 1 external object which does all database related activitlies. But the methods used here just does retriving objects from map which has all records read from the file.
Thanks Terry