Click here to Skip to main content
15,922,650 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Closing a view Pin
Nelek12-Sep-07 0:02
protectorNelek12-Sep-07 0:02 
Questiontree graph Pin
Chris Losinger7-Sep-07 10:48
professionalChris Losinger7-Sep-07 10:48 
AnswerRe: tree graph Pin
El Corazon7-Sep-07 11:25
El Corazon7-Sep-07 11:25 
AnswerRe: tree graph Pin
El Corazon7-Sep-07 11:32
El Corazon7-Sep-07 11:32 
QuestionMDI multiple view types - Window List Pin
bob169727-Sep-07 10:12
bob169727-Sep-07 10:12 
AnswerRe: MDI multiple view types - Window List Pin
bob169727-Sep-07 14:15
bob169727-Sep-07 14:15 
GeneralRe: MDI multiple view types - Window List Pin
bob169727-Sep-07 14:21
bob169727-Sep-07 14:21 
AnswerRe: MDI multiple view types - Window List Pin
Nelek12-Sep-07 0:08
protectorNelek12-Sep-07 0:08 
Copying from my answer above:

In my project, I had a CScrollView as MainView and then the possibility to hold a CFormView for EVERY element on the screen (up to 48). All secondary views should close without problems and /or asking to save changes on the document. I managed it with:

BOOL CMyDoc::CanCloseFrame(CFrameWnd* pFrame)
{	int nError = 0;

	//Closing the active window
	CView* pFrmView = pFrame->GetActiveView ();
	if (pFrmView->IsKindOf (RUNTIME_CLASS (CFormView)))
		return TRUE;

	//Closing automatically all secondary windows when the main one is closed by the user
	POSITION pos = GetFirstViewPosition ();	while (pos)
	{	CView* pView = GetNextView (pos);
		if (pView->IsKindOf (RUNTIME_CLASS (CFormView)))
		{	CFrameWnd* pTempFrame = pView->GetParentFrame ();
			if (pTempFrame)
				pTempFrame->DestroyWindow ();
		}
	}

	//Asking to save changes and so on.
	return CDocument::CanCloseFrame(pFrame);
}


Then I only have coded the OnDestroy in every secondary window to release all used memory and delete contents of listboxes, array and so on.

About the process of creating other windows... I have answered it as well in many times. Take a look with the search option in the forum (not in the articles) with my nick. It is quite good explained.

Greetings.

--------
M.D.V.

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

QuestionHow to prevent library/software cracking Pin
Hirakawa7-Sep-07 9:53
Hirakawa7-Sep-07 9:53 
AnswerRe: How to prevent library/software cracking Pin
David Crow7-Sep-07 10:16
David Crow7-Sep-07 10:16 
GeneralRe: How to prevent library/software cracking Pin
Hirakawa7-Sep-07 21:08
Hirakawa7-Sep-07 21:08 
QuestionUsing a resource from an ATL COM MFC Component Pin
cmacgowan7-Sep-07 9:45
cmacgowan7-Sep-07 9:45 
AnswerRe: Using a resource from an ATL COM MFC Component Pin
cmacgowan7-Sep-07 11:45
cmacgowan7-Sep-07 11:45 
QuestionHow to find Certificate Trust List by "Identifier" Pin
Joseph.Lightfoot7-Sep-07 6:18
Joseph.Lightfoot7-Sep-07 6:18 
AnswerRe: How to find Certificate Trust List by "Identifier" Pin
led mike7-Sep-07 7:34
led mike7-Sep-07 7:34 
GeneralRe: How to find Certificate Trust List by "Identifier" Pin
Joseph.Lightfoot7-Sep-07 9:18
Joseph.Lightfoot7-Sep-07 9:18 
GeneralRe: How to find Certificate Trust List by "Identifier" Pin
led mike7-Sep-07 11:42
led mike7-Sep-07 11:42 
QuestionType conversion! from BYTE[] to Point[] [modified] Pin
Md. Ali Naser Khan7-Sep-07 4:34
Md. Ali Naser Khan7-Sep-07 4:34 
AnswerRe: Type conversion! from BYTE[] to Point[] Pin
led mike7-Sep-07 5:07
led mike7-Sep-07 5:07 
JokeRe: Type conversion! from BYTE[] to Point[] Pin
David Crow7-Sep-07 5:14
David Crow7-Sep-07 5:14 
GeneralRe: Type conversion! from BYTE[] to Point[] Pin
jhwurmbach7-Sep-07 6:27
jhwurmbach7-Sep-07 6:27 
GeneralRe: Type conversion! from BYTE[] to Point[] Pin
Md. Ali Naser Khan7-Sep-07 5:14
Md. Ali Naser Khan7-Sep-07 5:14 
GeneralRe: Type conversion! from BYTE[] to Point[] Pin
Mark Salsbery7-Sep-07 5:30
Mark Salsbery7-Sep-07 5:30 
GeneralRe: Type conversion! from BYTE[] to Point[] Pin
led mike7-Sep-07 5:41
led mike7-Sep-07 5:41 
AnswerRe: Type conversion! from BYTE[] to Point[] Pin
John R. Shaw7-Sep-07 23:11
John R. Shaw7-Sep-07 23:11 

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.