Click here to Skip to main content
15,893,588 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Closing a view Pin
Mark Salsbery8-Sep-07 7:04
Mark Salsbery8-Sep-07 7:04 
GeneralRe: Closing a view Pin
bob169728-Sep-07 9:14
bob169728-Sep-07 9:14 
GeneralRe: Closing a view Pin
Mark Salsbery8-Sep-07 10:51
Mark Salsbery8-Sep-07 10:51 
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 
I have an MDI application with two view types for the same document. I am creating the instances of the second view type from an instance of the first view and then hiding all instances of the first view type using CFrameWnd::ActivateFrame() with a parameter equal to SW_HIDE. When all instances of the second view type are closed, all instances of the first view are reenabled using CFrameWnd::ActivateFrame() with a parameter equal to SW_SHOW.

It appears to work under certain circumstances and the window list in the menu appears to hide the references to those hidden frames. However, as I start to post WM_CLOSE messages to the visible views frame window class the window list gets quite out of sync and at the point I try to renable the instances of the first view types, nothing shows up in the window list even though the windows themselves are visible in the client area.

If I don't hide any views the window list remains in sync but I'd rather hide the views if possible.
Has anybody tried something like this before and got it to work?
// Here are some snippets

// CTheApp::InitInstance()

// First template
m_pDocTemplateFirst = new CMultiDocTemplate(
IDR_FIRST_TYPE,
RUNTIME_CLASS(CTheDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CFirstView));
if (!m_pDocTemplateFirst)
return FALSE;
AddDocTemplate(m_pDocTemplateFirst);

// Second template
m_pDocTemplateSecond = new CMultiDocTemplate(
IDR_SECOND_TYPE,
RUNTIME_CLASS(CTheDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CSecondView));
if (!m_pDocTemplateSecond)
return FALSE;
AddDocTemplate(m_pDocTemplateSecond);

// From the document class

// Creating the new view based on the second doctemplate
CFrameWnd* pFrame=pDocTemplate->CreateNewFrame(this,NULL);
if (pFrame) {
pDocTemplate->InitialUpdateFrame(pFrame,this,TRUE);
}

// Elsewhere

// Closing the frame and subsequently the view
pFrame->PostMessage(WM_CLOSE);
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 
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 

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.