Click here to Skip to main content
15,905,874 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Im trying to display the bitmap image in the dialog box. First time when i press the button it displays the image. Next time when i press, it shows the build assertion failed error.

This is the add button click function.
C#
void CsampleStudDlg::OnBnClickedAdd()
{

UpdateData();
Bmp.LoadBitmap(IDB_ADD);
m_Picture.SetBitmap(Bmp);
UpdateData(FALSE);
}


what i need to do is, to display the image whenever i press that button.

Thanks in advance..
Posted
Updated 7-Jan-13 0:02am
v2
Comments
[no name] 3-Dec-12 0:06am    
Not sure but try out this : UpdateData(TRUE);
J.Surjith Kumar 3-Dec-12 0:09am    
By default UpdateData() is TRUE.
[no name] 3-Dec-12 0:10am    
ok so call the default one and try agian..
J.Surjith Kumar 3-Dec-12 0:13am    
UpdateData(); is same as UpdateData(TRUE);
[no name] 3-Dec-12 0:15am    
You are not getting me, see this and try:
void CsampleStudDlg::OnBnClickedAdd()
{
Bmp.LoadBitmap(IDB_ADD);
m_Picture.SetBitmap(Bmp);
UpdateData();
}

1 solution

The solution is
C#
void CsampleStudDlg::OnBnClickedAdd()
{
UpdateData();
Bmp.LoadBitmap(IDB_ADD);
m_Picture.SetBitmap(Bmp);
Bmp.DeleteObject();
UpdateData(FALSE);
}


Thanks to CPallini.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900