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. Debug Assertion in CDialog::DoModal

Debug Assertion in CDialog::DoModal

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

    I am getting a debug assertion that I havn't ever seen before, and I cant figure it out.:confused: If anybody has any ideas pls let me know. Thanks Here is the constructor dec: CModemInterface(CStringArray* out, CWnd* pParent = NULL); And here is where I call the dialog: CStringArray* testFiles = new CStringArray(); for(int i = 0; i < 5; i++) { CString strTemp; strTemp.Format("Test%i.txt", (i + 1)); testFiles->Add(strTemp); } CModemInterface dlg(testFiles, this); if(dlg.DoModal() == IDOK) //crash here, traced into CDialog::DoModal delete testFiles; return; :confused:

    A 1 Reply Last reply
    0
    • E esapp420

      I am getting a debug assertion that I havn't ever seen before, and I cant figure it out.:confused: If anybody has any ideas pls let me know. Thanks Here is the constructor dec: CModemInterface(CStringArray* out, CWnd* pParent = NULL); And here is where I call the dialog: CStringArray* testFiles = new CStringArray(); for(int i = 0; i < 5; i++) { CString strTemp; strTemp.Format("Test%i.txt", (i + 1)); testFiles->Add(strTemp); } CModemInterface dlg(testFiles, this); if(dlg.DoModal() == IDOK) //crash here, traced into CDialog::DoModal delete testFiles; return; :confused:

      A Offline
      A Offline
      Alexandru Savescu
      wrote on last edited by
      #2

      What kind of assertion do you get? Does it crash in OnInitDialog? Best regards, Alexandru Savescu

      E 1 Reply Last reply
      0
      • A Alexandru Savescu

        What kind of assertion do you get? Does it crash in OnInitDialog? Best regards, Alexandru Savescu

        E Offline
        E Offline
        esapp420
        wrote on last edited by
        #3

        In dlgcore.cpp, function CDialog::DoModal(): // can be constructed with a resource template or InitModalIndirect ASSERT(m_lpszTemplateName != NULL || m_hDialogTemplate != NULL || m_lpDialogTemplate != NULL); //Fails here this is the first line of the function. any thoughts?? thanks

        P 1 Reply Last reply
        0
        • E esapp420

          In dlgcore.cpp, function CDialog::DoModal(): // can be constructed with a resource template or InitModalIndirect ASSERT(m_lpszTemplateName != NULL || m_hDialogTemplate != NULL || m_lpDialogTemplate != NULL); //Fails here this is the first line of the function. any thoughts?? thanks

          P Offline
          P Offline
          PJ Arends
          wrote on last edited by
          #4

          When you wrote the CModemInterface class constructor, did you remember to call the default CDialog constructor, passing along the dialog template Id?

          CModemInterface::CModemInterface (CStringArray *s, CWnd *pWnd)
          : CDialog (CModemInterface::IDD, pWnd)
          {
          // whatever
          }

          --- CPUA 0x5041 Sonork 100.11743 Chicken Little Orgasms are universal!! :omg: -- Mike Mullikin in The Lounge 21:27 15 May '02

          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