Modal Dailog Box
-
How do i open an Dialog BOx from the SDI Main Frame Menu. I tried to use Do.Modal()with the Dialog class object , but it caused an assetion. If i ignore the assertion, it runs perfectly fine. I want to get rid of that assertion.
-
What causes the assertion? SDI menu has nothing to do with a dialog box. I suspect that the dialog box is not initialized correctly. Kuphryn
-
I created an object of my Dialog class called Window.In order to open the dialog class i did Window.DoModal(); That is when assertion came up.
What is the assertion that occurred? Dave http://www.cloudsofheaven.org
-
What is the assertion that occurred? Dave http://www.cloudsofheaven.org
-
assertion says Debug Assertion failed. File:afxwin2.inl Line 162. i think it is due to some inappropraite use of function DoModal().
Can you post the code that you are using to create the dialog box as well please... it might make it a bit easier to see what is going on. Dave http://www.cloudsofheaven.org
-
assertion says Debug Assertion failed. File:afxwin2.inl Line 162. i think it is due to some inappropraite use of function DoModal().
It could be that your dialog contains a
CWnd
derived member that's not linked to a control. But it's impossible to say for sure unless you post some code. /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.com -
It could be that your dialog contains a
CWnd
derived member that's not linked to a control. But it's impossible to say for sure unless you post some code. /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.comhere is the Function that is used to create the dialog box when a SDI menu item is clicked.That menu item is called Jaguar. Jagwindow is my object for class CJaguarDlg. Hope this clarifies things. void CVR_ToolView::OnJaguar() { CJaguarDlg JagWindow; int nRet=JagWindow.DoModal(); }
-
here is the Function that is used to create the dialog box when a SDI menu item is clicked.That menu item is called Jaguar. Jagwindow is my object for class CJaguarDlg. Hope this clarifies things. void CVR_ToolView::OnJaguar() { CJaguarDlg JagWindow; int nRet=JagWindow.DoModal(); }
Sadly, that's of no help. How about posting the
OnInitDialog()
ofCJaguarDlg
. Also post its .h file. /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.com -
assertion says Debug Assertion failed. File:afxwin2.inl Line 162. i think it is due to some inappropraite use of function DoModal().
ppathan wrote: i think it is due to some inappropraite use of function DoModal(). No. Somewhere in your dialog or in one of the embedded controls, a
RedrawWindow()
is being called before the dialog is created properly, possibly inOnSize()
or something like that. If you've put this in, then do this:if(::IsWindow(m_hWnd))
RedrawWindow();Hope this helps,
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"