I hope you get some more answers than this one,
cause I believe there should be more ways of doing
this. Also, there is more details that may have to
be considered (like sharing menus and so on).
First you must create a CFormView derived class for
each dialog resource.
Then register all these classes in your app
(InitInstance), copying the code for the
AddDocTemplate stuff. You can use the same document
class for all views if you like.
I believe there is an easier way to create views,
but the following suits my needs:
POSITION pos=GetFirstDocTemplatePosition();
CDocument *pDoc=NULL;
int i;
for (i=0; i<=ix; i++) Get the desired template
pDT=GetNextDocTemplate(pos);
CFrameWnd * pFrame;
pDT->InitialUpdateFrame(pFrame=pDT->CreateNewFrame(pDoc=pDT->CreateNewDocument(),
NULL), pDoc);
/Glenn
Quote:
> Hello,
> I am writing a MDI program, and it is my first attempt at using the MFC
> document/view architecture. Anyway, when I was beginning the program
> with the AppWizard, I told it to make the view of type CFormView, so
> that I could have something like a dialog in the MDI application. But
> this makes all the views the same dialog resource. I don't even need the
> document part, and I already got rid of the new/open/save file stuff.
> Basically what I want to write is one program that has a main dialog
> View, and then say they press a settings button, then it shows a child
> CFormView as the view with a different dialog resource for settings. All
> I can get it to do is show the same CFormView dialog as the view, how
> can I make my own windows for it to show, I already have the dialogs
> made, I just want different ones to show, not just the same one. I hope
> you understand my meaning. I have a few books on MFC, but none go into
> this type of thing. It was easy in VB, but how in VC?
> It is just the same as creating multiple Dialog apps, and then
> containing them all in one Main Window.
> Thanks!
> Ryan Kelley