Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello all,

I Have an MDI MFC application un der VS2005, I have some doc/view classes (like CUsersDoc/CUsersView).

I was attempting to create a new pair of (Doc/View) and i could not how to do that:

I created a Document Based Class then i Created a CFormView Based One With The Doc Class as DocumentTemplate but when i tried to see the already created Doc classes i saw lignes like

C++
 #if!defined(AFX_BFICONSULTATIONDOC_H__4D72AF8D_2711_11D4_99F9_0050BA015F99__INCLUDED_)
#define AFX_BFICONSULTATIONDOC_H__4D72AF8D_2711_11D4_99F9_0050BA015F99__INCLUDED_
....


But the one that i created dosen't include such lines.

So People is there a link to a good tutorial for creating Doc/View Classes in MDI Applicaions.
Posted
Updated 7-Apr-12 13:35pm
v4

Was easy, just duplucate the FormView and then duplicate the code of the ParentView in the InitInstance().
 
Share this answer
 
Comments
Monjurul Habib 8-Apr-12 12:19pm    
5!
Check this out here for the basics :
Creating your first MFC Doc/View application[^]

C++
 #if!defined(AFX_BFICONSULTATIONDOC_H__4D72AF8D_2711_11D4_99F9_0050BA015F99__INCLUDED_)
#define AFX_BFICONSULTATIONDOC_H__4D72AF8D_2711_11D4_99F9_0050BA015F99__INCLUDED_


coming to the above 2 lines : This will help to include the file only one time per compilation process. If this is not there then the same .h will be included multiple times and this may lead to multiple definition errors. You can also use #pragma once instead, but there are few things to note - #ifndef vs #pragma[^]
 
Share this answer
 
Comments
Schehaider_Aymen 8-Apr-12 12:09pm    
Thank you for the answer but it was not what i was looking for.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900