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. Dialog Problem

Dialog Problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++debuggingbeta-testinglearning
3 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.
  • F Offline
    F Offline
    FieldHawk
    wrote on last edited by
    #1

    Hi Folks i am here with a problem I did the followin things in my SDI VC application(MFC exe with default App wizrad options) 1.Created a Dialog Resource with a ComboBox(Attached a Control Variable to that m_ctrlCombo) ,attached a new class to it ( CTestDlg ). 2.Created object of CTestDlg in view class in OnLButtonDown() [code] void CTestView::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default CTestDlg dlg; dlg.m_ctrlCombo.AddString("Alpha"); dlg.m_ctrlCombo.AddString("Beta"); dlg.DoModal(); CView::OnLButtonDown(nFlags, point); } [/code] The Problem is that when i run the application and OnLButtonDown() Function is invoked .I get a debug assetion failure * "File: afxwin2.inl Line 735 " when i ignore it two times the Dialog is shown but no string attached to the comboBox Plz help me out Folks to solve this. Thanx in advance.

    M 1 Reply Last reply
    0
    • F FieldHawk

      Hi Folks i am here with a problem I did the followin things in my SDI VC application(MFC exe with default App wizrad options) 1.Created a Dialog Resource with a ComboBox(Attached a Control Variable to that m_ctrlCombo) ,attached a new class to it ( CTestDlg ). 2.Created object of CTestDlg in view class in OnLButtonDown() [code] void CTestView::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default CTestDlg dlg; dlg.m_ctrlCombo.AddString("Alpha"); dlg.m_ctrlCombo.AddString("Beta"); dlg.DoModal(); CView::OnLButtonDown(nFlags, point); } [/code] The Problem is that when i run the application and OnLButtonDown() Function is invoked .I get a debug assetion failure * "File: afxwin2.inl Line 735 " when i ignore it two times the Dialog is shown but no string attached to the comboBox Plz help me out Folks to solve this. Thanx in advance.

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #2

      jinbabaj wrote: dlg.m_ctrlCombo.AddString("Alpha"); dlg.m_ctrlCombo.AddString("Beta"); This should be in the InitDialog method of the dialog. The assert pops because the dialog is not CREATED, only constructed, and will be created in the DoModal method.


      Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )

      T 1 Reply Last reply
      0
      • M Maximilien

        jinbabaj wrote: dlg.m_ctrlCombo.AddString("Alpha"); dlg.m_ctrlCombo.AddString("Beta"); This should be in the InitDialog method of the dialog. The assert pops because the dialog is not CREATED, only constructed, and will be created in the DoModal method.


        Maximilien Lincourt "Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )

        T Offline
        T Offline
        Thomas Lau
        wrote on last edited by
        #3

        Yes!Maximilien is right!

        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