Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. 0xC000001D "Fatal Application Error" ????

0xC000001D "Fatal Application Error" ????

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionc++debugging
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Trupti Mehta
    wrote on last edited by
    #1

    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

    R D K 3 Replies Last reply
    0
    • T Trupti Mehta

      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

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      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

      T 1 Reply Last reply
      0
      • T Trupti Mehta

        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

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        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

        T 1 Reply Last reply
        0
        • T Trupti Mehta

          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

          K Offline
          K Offline
          krmed
          wrote on last edited by
          #4

          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

          S 1 Reply Last reply
          0
          • K krmed

            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

            S Offline
            S Offline
            Stephen Hewitt
            wrote on last edited by
            #5

            krmed wrote:

            is not Unicode. Use m_opNo = _tstoi((LPCSTSTR)csValue);

            Or even better use no explicit cast:

            m_opNo = _tstoi(csValue);

            Steve

            1 Reply Last reply
            0
            • R Rajesh R Subramanian

              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

              T Offline
              T Offline
              Trupti Mehta
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • D David Crow

                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

                T Offline
                T Offline
                Trupti Mehta
                wrote on last edited by
                #7

                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

                D 1 Reply Last reply
                0
                • T Trupti Mehta

                  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

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  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

                  T 1 Reply Last reply
                  0
                  • D David Crow

                    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

                    T Offline
                    T Offline
                    Trupti Mehta
                    wrote on last edited by
                    #9

                    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

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups