C++ School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a C++ Expert!

Join 306,822 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,768 people online right now. Registration is fast and FREE... Join Now!




MFC Debug Assertion failed!

 

MFC Debug Assertion failed!

hariparam

31 Mar, 2009 - 07:50 AM
Post #1

New D.I.C Head
*

Joined: 2 Feb, 2009
Posts: 6

CODE


I have two dialog boxes in my application. Buttion click on first dilaog will display the second dialog box.

void CBranchRegionDBDlg::OnBnClickedOk()
{
    // TODO: Add your control notification handler code here
    CLBRegionDlg dlg;
    CDialog::ShowWindow(FALSE);
    dlg.DoModal();

}

in the dialog box, there is buttion lcik function, assinging a string value to the edit box member varibale of type CString,  after that I am calling UpdateData(false) to populate the data into the edit box.

void CLBRegionDlg::OnBnClickedOk()
{

  
    m_szStatus = "hello world";  
    UpdateData(FALSE);

}

but UpdateData(FALSE) throwing an error

[b]Debug Assertion failed![/b]

Pointing to the following line in wincore.cpp
        CHandleMap* pMap = afxMapHWND();
        ASSERT(pMap != NULL); // error points here.



I need help in this. I am using Visual Studio 2008

Thanks in advcance.

User is offlineProfile CardPM
+Quote Post


erik.price

RE: MFC Debug Assertion Failed!

31 Mar, 2009 - 01:44 PM
Post #2

Segfault Artist
Group Icon

Joined: 18 Dec, 2008
Posts: 752



Thanked: 30 times
Dream Kudos: 575
My Contributions
What is your specific question?
User is online!Profile CardPM
+Quote Post

KYA

RE: MFC Debug Assertion Failed!

31 Mar, 2009 - 01:58 PM
Post #3

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 11,489



Thanked: 507 times
Dream Kudos: 2875
Expert In: C, C++, Java

My Contributions
Basically its saying that the pointer handle is NULL, that's why it failed the assertion.
User is online!Profile CardPM
+Quote Post

Reply to this topicStart new topic

Time is now: 11/20/09 10:29PM

Live C++ Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month