School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
Welcome to Dream.In.Code
Become an Expert!

Join 340,144 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 3,819 people online right now. Registration is fast and FREE... Join Now!



MFC Debug Assertion failed!

MFC Debug Assertion failed! Rate Topic: -----

#1 hariparam  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: New Members
  • Posts: 6
  • Joined: 02-February 09


Dream Kudos: 0

Posted 31 March 2009 - 07:50 AM


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.
Was This Post Helpful? 0
  • +
  • -


#2 erik.price  Icon User is offline

  • D.I.C Lover
  • Icon
  • View blog
  • Group: Expert w/DIC++
  • Posts: 1,706
  • Joined: 18-December 08


Dream Kudos: 1400

Expert In: C, C++, Java, Ruby

Posted 31 March 2009 - 01:44 PM

What is your specific question?
Was This Post Helpful? 0
  • +
  • -

#3 KYA  Icon User is online

  • while(sad){!sad; awesome();}
  • Icon
  • View blog
  • Group: Mentors
  • Posts: 13,183
  • Joined: 14-September 07


Dream Kudos: 3000

Expert In: C, C++, Java

Posted 31 March 2009 - 01:58 PM

Basically its saying that the pointer handle is NULL, that's why it failed the assertion.
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

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

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month