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. pls help me

pls help me

Scheduled Pinned Locked Moved C / C++ / MFC
debugginghelpquestion
8 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.
  • S Offline
    S Offline
    saisp
    wrote on last edited by
    #1

    hi i am calling a dialog function from another function as CMyConnCustomInstall *CustomDlg = new CMyConnCustomInstall; but it is getting crashed in debug state? why this occurs pls help me; my code is: f(pCustInst->GetCheck()) { CDialog::OnOK(); CMyConnCustomInstall *CustomDlg = new CMyConnCustomInstall; CustomDlg->DoModal(); }

    T H C D 4 Replies Last reply
    0
    • S saisp

      hi i am calling a dialog function from another function as CMyConnCustomInstall *CustomDlg = new CMyConnCustomInstall; but it is getting crashed in debug state? why this occurs pls help me; my code is: f(pCustInst->GetCheck()) { CDialog::OnOK(); CMyConnCustomInstall *CustomDlg = new CMyConnCustomInstall; CustomDlg->DoModal(); }

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

      Hi, I tested the same code without crash. After 'if', are there anymore statements? Thammadi

      S 1 Reply Last reply
      0
      • T thammadi

        Hi, I tested the same code without crash. After 'if', are there anymore statements? Thammadi

        S Offline
        S Offline
        saisp
        wrote on last edited by
        #3

        no i have to close the present dialog(from where i have to call the next dialog) and open the next dialog.

        1 Reply Last reply
        0
        • S saisp

          hi i am calling a dialog function from another function as CMyConnCustomInstall *CustomDlg = new CMyConnCustomInstall; but it is getting crashed in debug state? why this occurs pls help me; my code is: f(pCustInst->GetCheck()) { CDialog::OnOK(); CMyConnCustomInstall *CustomDlg = new CMyConnCustomInstall; CustomDlg->DoModal(); }

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          What happens if you run

          CustomDlg->Create();
          CustomDlg->ShowWindow(1);


          WhiteSky


          1 Reply Last reply
          0
          • S saisp

            hi i am calling a dialog function from another function as CMyConnCustomInstall *CustomDlg = new CMyConnCustomInstall; but it is getting crashed in debug state? why this occurs pls help me; my code is: f(pCustInst->GetCheck()) { CDialog::OnOK(); CMyConnCustomInstall *CustomDlg = new CMyConnCustomInstall; CustomDlg->DoModal(); }

            C Offline
            C Offline
            Chilli71
            wrote on last edited by
            #5

            Is the line where you call CDialog::OnOK() inside a member function of the CDialog? Regards Leo

            C S 2 Replies Last reply
            0
            • C Chilli71

              Is the line where you call CDialog::OnOK() inside a member function of the CDialog? Regards Leo

              C Offline
              C Offline
              Chilli71
              wrote on last edited by
              #6

              Let's accallerate this, so that I do not need to wait for your reply. Also I'm not sure, if my question was clear. I suppose you are doing something like

              DialogA::OnUpdateUI()
              {
              CDialog::OnOK();
              pDialogB = new Dialog B;
              ...
              }

              Since OnOK() of the base clase does the same like hitting the OK button I guess that DialogA is destroyed. If this is true than at the next line you try to execute code in a non existent object. Maybe

              DialogA::OnUpdateUI()
              {
              DialogA.ShowWindow(FALSE);
              pDialogB = new Dialog B;
              ...
              CDialog::OnOK();
              }

              works? Regards Leo

              1 Reply Last reply
              0
              • C Chilli71

                Is the line where you call CDialog::OnOK() inside a member function of the CDialog? Regards Leo

                S Offline
                S Offline
                saisp
                wrote on last edited by
                #7

                yes its inside the member function

                1 Reply Last reply
                0
                • S saisp

                  hi i am calling a dialog function from another function as CMyConnCustomInstall *CustomDlg = new CMyConnCustomInstall; but it is getting crashed in debug state? why this occurs pls help me; my code is: f(pCustInst->GetCheck()) { CDialog::OnOK(); CMyConnCustomInstall *CustomDlg = new CMyConnCustomInstall; CustomDlg->DoModal(); }

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

                  saisp wrote:

                  ...but it is getting crashed in debug state?

                  Are we supposed to guess where? :rolleyes:


                  "A good athlete is the result of a good and worthy opponent." - David Crow

                  "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                  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