Rud1ger Sch1erz
2006-11-02 20:35:40 UTC
Hi,
I use DocTemplate to create multiple views of one document in a MDI
environment.
One of those views is of type CFormView.
class CBSatzFilterView : public CFormView
When the user makes a click on the ok-button in this form, I want to
close and destroy this certain view. I found out, how to use
CDocTemplates to let the framework create views, but not to
close/destroy views on demand.
My current solution is, to install a message-handler in my
CBSatzFilterView like this:
void CBSatzFilterView::OnBnClickedOk()
{
// Do some changes to the document and then:
GetDocument()->UpdateAllViews(this);
GetDocument()->RemoveView(this);
((CChildFrame*)GetParentFrame())->OnClose();
}
This seems to work.
My question is: Is there a more MDI-framework-like way to this? Have I
overlooked something?
Cheers from Germany,
Rudiger
I use DocTemplate to create multiple views of one document in a MDI
environment.
One of those views is of type CFormView.
class CBSatzFilterView : public CFormView
When the user makes a click on the ok-button in this form, I want to
close and destroy this certain view. I found out, how to use
CDocTemplates to let the framework create views, but not to
close/destroy views on demand.
My current solution is, to install a message-handler in my
CBSatzFilterView like this:
void CBSatzFilterView::OnBnClickedOk()
{
// Do some changes to the document and then:
GetDocument()->UpdateAllViews(this);
GetDocument()->RemoveView(this);
((CChildFrame*)GetParentFrame())->OnClose();
}
This seems to work.
My question is: Is there a more MDI-framework-like way to this? Have I
overlooked something?
Cheers from Germany,
Rudiger