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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. When edit control is added to a dialog, application is crashing

When edit control is added to a dialog, application is crashing

Scheduled Pinned Locked Moved C / C++ / MFC
help
7 Posts 4 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.
  • B Offline
    B Offline
    BiswaR
    wrote on last edited by
    #1

    I have a dialog box with id IDD_AGREE_FRAME_ABSTRACTION . This class's all cotrols are populated from the view class using one LoadDetails() function which is implemented inside the dialog class. I have added an edit box to this dialog. But when ever i am creating any variable of type: 1. CString and attaching it to the editbox through class wizard/manually. It's giving me a message "An unsupported operation was attempted". When i click that msg box the application is getting crashed. 2. CEdit then i am getting the message and the application is crashing. When i am debugging the application the message box is coming in the DoDataExchange i for that particular entry for that editbox control. I deleted the entry in the DoDataExchange for the control and just tried to set a its text by using GetDldItem(IDC_EDIT_BLDG_AGE)->SetWindowText("biswa") but again the application is crashing. For all the cases when its crashing it's giving the error as "Unhandled exception in the app.exe(MFC42D.DLL):0x0000005: Access Violation." I am really surprised why this is happening for this dialog where as for other dialog there is no problem when i do the same. Also when i am removing the the DDX_Text entry for the control causing the problem the whole application is running fine. Please help me on this. This is really important for me. If you need any more information then just tell me i can give you the detail history for this.

    T D 2 Replies Last reply
    0
    • B BiswaR

      I have a dialog box with id IDD_AGREE_FRAME_ABSTRACTION . This class's all cotrols are populated from the view class using one LoadDetails() function which is implemented inside the dialog class. I have added an edit box to this dialog. But when ever i am creating any variable of type: 1. CString and attaching it to the editbox through class wizard/manually. It's giving me a message "An unsupported operation was attempted". When i click that msg box the application is getting crashed. 2. CEdit then i am getting the message and the application is crashing. When i am debugging the application the message box is coming in the DoDataExchange i for that particular entry for that editbox control. I deleted the entry in the DoDataExchange for the control and just tried to set a its text by using GetDldItem(IDC_EDIT_BLDG_AGE)->SetWindowText("biswa") but again the application is crashing. For all the cases when its crashing it's giving the error as "Unhandled exception in the app.exe(MFC42D.DLL):0x0000005: Access Violation." I am really surprised why this is happening for this dialog where as for other dialog there is no problem when i do the same. Also when i am removing the the DDX_Text entry for the control causing the problem the whole application is running fine. Please help me on this. This is really important for me. If you need any more information then just tell me i can give you the detail history for this.

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      did you try to use the debugger to see step by step where it crashes ?


      TOXCCT >>> GEII power
      [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]

      B 1 Reply Last reply
      0
      • T toxcct

        did you try to use the debugger to see step by step where it crashes ?


        TOXCCT >>> GEII power
        [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]

        B Offline
        B Offline
        BiswaR
        wrote on last edited by
        #3

        When the dialog is created in the view class it calls the DoDataExchange function and when it excutes the line DDX_Text(pDX,IDC_EDIT_BUILDING_AGE,m_BuildingAge) it crashes and when i remove the entry it works fine. Also as i said when directly try to access by it using GetDlgItem then also it crashes. One more thing i want to say this class was not visible when opened the class wizard. So i deleted the .clw file and agained opened it. That class was then visible but when i selected that i got parsing error for one of entries of DoDataExchange function that is DDX_Dollar(.....). That is why i added entry for this control manually.

        _ 1 Reply Last reply
        0
        • B BiswaR

          I have a dialog box with id IDD_AGREE_FRAME_ABSTRACTION . This class's all cotrols are populated from the view class using one LoadDetails() function which is implemented inside the dialog class. I have added an edit box to this dialog. But when ever i am creating any variable of type: 1. CString and attaching it to the editbox through class wizard/manually. It's giving me a message "An unsupported operation was attempted". When i click that msg box the application is getting crashed. 2. CEdit then i am getting the message and the application is crashing. When i am debugging the application the message box is coming in the DoDataExchange i for that particular entry for that editbox control. I deleted the entry in the DoDataExchange for the control and just tried to set a its text by using GetDldItem(IDC_EDIT_BLDG_AGE)->SetWindowText("biswa") but again the application is crashing. For all the cases when its crashing it's giving the error as "Unhandled exception in the app.exe(MFC42D.DLL):0x0000005: Access Violation." I am really surprised why this is happening for this dialog where as for other dialog there is no problem when i do the same. Also when i am removing the the DDX_Text entry for the control causing the problem the whole application is running fine. Please help me on this. This is really important for me. If you need any more information then just tell me i can give you the detail history for this.

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

          When does LoadDetails() get called?


          "The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli

          B 1 Reply Last reply
          0
          • D David Crow

            When does LoadDetails() get called?


            "The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli

            B Offline
            B Offline
            BiswaR
            wrote on last edited by
            #5

            The LoadDetail() is called in the OnUpdate() of the view class.

            D 1 Reply Last reply
            0
            • B BiswaR

              The LoadDetail() is called in the OnUpdate() of the view class.

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

              BiswaR wrote:

              The LoadDetail() is called in the OnUpdate() of the view class.

              Before or after the dialog's DoModal() method is called?


              "The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli

              1 Reply Last reply
              0
              • B BiswaR

                When the dialog is created in the view class it calls the DoDataExchange function and when it excutes the line DDX_Text(pDX,IDC_EDIT_BUILDING_AGE,m_BuildingAge) it crashes and when i remove the entry it works fine. Also as i said when directly try to access by it using GetDlgItem then also it crashes. One more thing i want to say this class was not visible when opened the class wizard. So i deleted the .clw file and agained opened it. That class was then visible but when i selected that i got parsing error for one of entries of DoDataExchange function that is DDX_Dollar(.....). That is why i added entry for this control manually.

                _ Offline
                _ Offline
                _anil_
                wrote on last edited by
                #7

                just try the follow this may be reason.... in resourse.h IDC_EDIT_BUILDING_AGE is defined right. it has some value say 1234 check there should not any other defined with the same value 1234. just check it. as a one of the reasons. Regards Anil

                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