15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


MFC Multiple Documents/Multiple Views

kaajit@pcsbom.patni.com
Friday, November 08, 1996

Environment :Visual C++ 1.51, Windows 3.11, 16-bit


Hello,
I am trying to implement an MDI application, WE have multiple document 
types, ( I am aware of the sample MULTIDOCS but cant find it anywhere)
There are 3 view classes and all the documents would have the same three views
Any brief idea of implementing, managing the different documents along with
the views.
I am not supposed to use Splitter Windows !

Conceptually it would seem this way...

Document Type One (File extension ".out") :- CBarView, CHistoView, CPieView
                                                  CView Derived 

Document Type Two (File extension ".pda") :- 
	CDocument Deerived

K.M.Ajit
kaajit@pcsbom.patni.com

 



T.K.Wessing -- tkw@xs4all.nl
Tuesday, November 19, 1996

Hi,
the trick lies in the CMyApp::InitInstance()
Here you will find/insert calls like this ones:

	m_pDrawViewTemplate = new CMultiDocTemplate(
		IDR_EDRAWTYPE,			// resource ID: points to seperated string WITH
extention etc.
		RUNTIME_CLASS(CMyDoc1),		// Doc 1
		RUNTIME_CLASS(CChildFrame),		// custom MDI child frame
		RUNTIME_CLASS(CMyView1));		// the View
	AddDocTemplate(m_pDrawViewTemplate);

	m_pListViewTemplate = new CMultiDocTemplate(
		IDR_EDRAWTYPE2,			// an other resource string WITHOUT extention
		RUNTIME_CLASS(CMyDoc1),		// the same Doc 1
		RUNTIME_CLASS(CChildFrame),		// custom MDI child frame
		RUNTIME_CLASS(CMyView2));		// an other view on the same kind of data
	AddDocTemplate(m_pListViewTemplate);

	m_pListViewTemplate = new CMultiDocTemplate(
		IDR_EDRAWTYPE3,			// resource ID: points to separated string WITH
extention etc.
		RUNTIME_CLASS(CMyDoc2),		// Doc 2
		RUNTIME_CLASS(CChildFrame),		// custom MDI child frame
		RUNTIME_CLASS(CMyView3));		// an other view on the same kind of data
	AddDocTemplate(m_pListViewTemplate);

See MSDN for more or mail to
/=====================================
|  T.K.Wessing
|  Senior Software Engineer
|  Caledon Systems International BV
|  The Netherlands
|  Private E-Mail:
|  tkw@xs4all.nl
\=====================================
The Nedherlands ?
Yep, "The Nedherlands" It does exists indeed!


----------
> From: kaajit@pcsbom.patni.com
> To: mfc-l@netcom.com
> Subject: MFC Multiple Documents/Multiple Views
> Date: Friday, November 08, 1996 5:13 PM
> 
> Environment :Visual C++ 1.51, Windows 3.11, 16-bit
> 
> 
> Hello,
> I am trying to implement an MDI application, WE have multiple document 
> types, ( I am aware of the sample MULTIDOCS but cant find it anywhere)
> There are 3 view classes and all the documents would have the same three
views
> Any brief idea of implementing, managing the different documents along
with
> the views.
> I am not supposed to use Splitter Windows !
> 
> Conceptually it would seem this way...
> 
> Document Type One (File extension ".out") :- CBarView, CHistoView,
CPieView
>                                                   CView Derived 
> 
> Document Type Two (File extension ".pda") :- 
> 	CDocument Deerived
> 
> K.M.Ajit
> kaajit@pcsbom.patni.com
> 
>  




| Вернуться в корень Архива |