Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 17th, 2003, 02:28 PM
Registered User
 
Join Date: Sep 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to elleetan Send a message via MSN to elleetan Send a message via Yahoo to elleetan
Default "Debug Assertion Failure"

At first, I only created CMy123Dlg dialog box, but later i decided to add others dialog box.
there are 3 dialog boxes that i had created,

1)CMenuDlg
2)CMonitorDlg
3)CSynrinceDlg

CMenuDlg have 3 buttons which are BInfusion, BMonitor, BSynrince

what i want my appication run are:
1) the CMenuDlg load first

i)if i click the BInfusion, it will go to the CMy123Dlg
ii) if i click the BMonitor button , it will go ot the CMonitorDlg
iii)if i click the Bsyrince it will go to the CSynrinceDlg

Here is my code:

BOOL CMy123App :: InitInstance()
{
    CMenuDlg firstDlg;

    firstDlg.DoModal();

    return FALSE;
}



////then i do the same at other buttons on the CMenuDlg:
void CMenuDlg::OnInfusion()
{
    // TODO: Add your control notification handler code here

    CMy123Dlg DlgMy123;
    DlgMy123.DoModal();
}

void CMenuDlg::OnMonitor()
{
    // TODO: Add your control notification handler code here
    CMonitorDlg DlgMonitor;
    DlgMonitor.DoModal();

}

void CMenuDlg::OnSyringe()
{
    // TODO: Add your control notification handler code here
    m_dSyringDlg.DoModal();
}
my application is working but it will "Debug assertion failed,"when i execute it. However if i clicked on the ignore button it will run my program. i knew thw error is that after i had added code in the CMenuDlg::OnInfusion(); it will prompt me the "debug Assertion failure" dialog box when i execute it, but i don't know how to solve it.

this is the error file :
File: afxwin1.inl
Line:22



im new to Visual C++, i need your help.
Whats wrong with my code.... how do i clear the "debug assertion failure" dialog box? ???could you help me please??
thank you very much..




 
Old December 24th, 2003, 08:29 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Hi Elleetan

It seems there is some problem with the initialization code of CMy123Dlg. Either in OnInitdialog or in its constructor or it could be that you had a control on this dialog for which you had a reference in the DoDataExchange function and now you have deleted that control without deleting its reference entry in DoDataExchange.

Write back if there is anything else you wanna ask.


Ankur Verma
.Net and C++ Specialist
Wiley Tech Support
 
Old September 20th, 2005, 06:22 AM
Registered User
 
Join Date: Aug 2005
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by elleetan
 At first, I only created CMy123Dlg dialog box, but later i decided to add others dialog box.
there are 3 dialog boxes that i had created,

1)CMenuDlg
2)CMonitorDlg
3)CSynrinceDlg

CMenuDlg have 3 buttons which are BInfusion, BMonitor, BSynrince

what i want my appication run are:
1) the CMenuDlg load first

i)if i click the BInfusion, it will go to the CMy123Dlg
ii) if i click the BMonitor button , it will go ot the CMonitorDlg
iii)if i click the Bsyrince it will go to the CSynrinceDlg

Here is my code:

BOOL CMy123App :: InitInstance()
{
    CMenuDlg firstDlg;

    firstDlg.DoModal();

    return FALSE;
}



////then i do the same at other buttons on the CMenuDlg:
void CMenuDlg::OnInfusion()
{
    // TODO: Add your control notification handler code here

    CMy123Dlg DlgMy123;
    DlgMy123.DoModal();
}

void CMenuDlg::OnMonitor()
{
    // TODO: Add your control notification handler code here
    CMonitorDlg DlgMonitor;
    DlgMonitor.DoModal();

}

void CMenuDlg::OnSyringe()
{
    // TODO: Add your control notification handler code here
    m_dSyringDlg.DoModal();
}
my application is working but it will "Debug assertion failed,"when i execute it. However if i clicked on the ignore button it will run my program. i knew thw error is that after i had added code in the CMenuDlg::OnInfusion(); it will prompt me the "debug Assertion failure" dialog box when i execute it, but i don't know how to solve it.

this is the error file :
File: afxwin1.inl
Line:22



im new to Visual C++, i need your help.
Whats wrong with my code.... how do i clear the "debug assertion failure" dialog box? ???could you help me please??
thank you very much..




 
Old September 20th, 2005, 06:25 AM
Registered User
 
Join Date: Aug 2005
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,



I am working on VC++ using a win32 application. I tried to create a dialog box using CFileDialog class.

An assertion fail error message occurred when the program is compiled. But in the program I initialized

MFC creating a global object and AfxWinInit method..



Could you please help me out why and where I am facing the problem…..



Thanks and Regards

D.Virajitha Sarma







Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmer's assertion in getNextStepPos dishant XSLT 1 April 11th, 2008 09:48 AM
what is an assertion? coreyalbrightsr Java Basics 3 October 2nd, 2007 06:54 PM
Debug assertion failure for wincore aparnakamath2000 Visual C++ 0 August 28th, 2007 05:49 AM
Debug assertion about m_pCtrlSite attaboyu Visual C++ 10 November 14th, 2005 01:53 PM
Help in Assertion failure abdelkader Visual C++ 0 December 30th, 2003 10:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.