Click here to Skip to main content
15,920,468 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionClosing childview in MDI [SOLVED] Pin
Anu_Bala15-Feb-11 18:23
Anu_Bala15-Feb-11 18:23 
Hi,In my MDI application,i want to close each child window with confirm message.
For this in each view,OnClose() fucntion i coded like
void CAlarmView::OnClose()
{
	if(AfxMessageBox("Do you want to close the Alarm?",MB_YESNO|MB_DEFBUTTON2,NULL) == IDNO)
	        return;	
	CView::OnClose();
}
But when i close the child window it does not go this OnClose() function itself.
So i gave this OnDestroy() fucntion.

void CAlarmView::OnDestroy() 
{

	if(AfxMessageBox("Do you want to close the Alarm?",MB_YESNO|MB_DEFBUTTON2,NULL) == IDNO)
		return;	
       CView::OnDestroy();
}

When the application shows this confirm message,when i press NO , the child window is getting closed.Actually if i press YES then the child window should close,if i press NO it doesnot get close.

Pls help me in this concern
Anu
modified on Wednesday, February 16, 2011 2:02 AM

AnswerRe: Closing childview in MDI Pin
tagopi15-Feb-11 18:53
tagopi15-Feb-11 18:53 
AnswerRe: Closing childview in MDI Pin
_AnsHUMAN_ 15-Feb-11 19:02
_AnsHUMAN_ 15-Feb-11 19:02 
AnswerRe: Closing childview in MDI Pin
Anu_Bala15-Feb-11 20:01
Anu_Bala15-Feb-11 20:01 
QuestionHow to bring an App to front, from another App Pin
timbk15-Feb-11 15:50
timbk15-Feb-11 15:50 
QuestionRe: How to bring an App to front, from another App Pin
David Crow15-Feb-11 16:54
David Crow15-Feb-11 16:54 
AnswerRe: How to bring an App to front, from another App Pin
Anthony Mushrow15-Feb-11 16:58
professionalAnthony Mushrow15-Feb-11 16:58 
GeneralRe: How to bring an App to front, from another App Pin
timbk16-Feb-11 0:32
timbk16-Feb-11 0:32 
GeneralRe: How to bring an App to front, from another App Pin
Anthony Mushrow16-Feb-11 3:31
professionalAnthony Mushrow16-Feb-11 3:31 
GeneralRe: How to bring an App to front, from another App Pin
timbk16-Feb-11 11:06
timbk16-Feb-11 11:06 
GeneralRe: How to bring an App to front, from another App Pin
Anthony Mushrow16-Feb-11 12:03
professionalAnthony Mushrow16-Feb-11 12:03 
GeneralRe: How to bring an App to front, from another App Pin
timbk16-Feb-11 16:54
timbk16-Feb-11 16:54 
GeneralRe: How to bring an App to front, from another App Pin
Anthony Mushrow16-Feb-11 17:28
professionalAnthony Mushrow16-Feb-11 17:28 
QuestionHow to split the frame as three part? [Solved] Pin
yu-jian15-Feb-11 14:43
yu-jian15-Feb-11 14:43 
AnswerRe: How to split the frame as three part? Pin
Richard MacCutchan15-Feb-11 23:05
mveRichard MacCutchan15-Feb-11 23:05 
QuestionQuestion about CListCtrl Pin
Hans Dietrich15-Feb-11 13:15
mentorHans Dietrich15-Feb-11 13:15 
AnswerRe: Question about CListCtrl Pin
Rolf Kristensen15-Feb-11 14:36
Rolf Kristensen15-Feb-11 14:36 
AnswerRe: Question about CListCtrl Pin
ThatsAlok15-Feb-11 21:14
ThatsAlok15-Feb-11 21:14 
GeneralRe: Question about CListCtrl Pin
Hans Dietrich15-Feb-11 21:25
mentorHans Dietrich15-Feb-11 21:25 
QuestionHow to Use ODBC API for SQLFetchScroll. Pin
janaswamy uday15-Feb-11 2:22
janaswamy uday15-Feb-11 2:22 
AnswerRe: How to Use ODBC API for SQLFetchScroll. Pin
Niklas L15-Feb-11 2:51
Niklas L15-Feb-11 2:51 
QuestionMenu in ChildWindow Pin
Anu_Bala15-Feb-11 0:14
Anu_Bala15-Feb-11 0:14 
QuestionHow do I recalculated the checksum in the bookmarks file of chrome after changing it manually? Pin
yogish29314-Feb-11 23:52
yogish29314-Feb-11 23:52 
AnswerRe: How do I recalculated the checksum in the bookmarks file of chrome after changing it manually? Pin
Andrew Brock15-Feb-11 1:41
Andrew Brock15-Feb-11 1:41 
QuestionUnicode, Unicode Big Endian or UTF-8? What is the difference? Which format is better to write a text file? Pin
Le@rner14-Feb-11 23:35
Le@rner14-Feb-11 23:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.