different CView derived views on same document
-
-
I have a MFC MDI program, where I want to have in their own MDIchildframe windows both CScrollView based view and CListView based view. (Data neatly in CListView window, graphics in CScrollView window) How can I accomplish that? :confused: TIA -Marko
-
I have a MFC MDI program, where I want to have in their own MDIchildframe windows both CScrollView based view and CListView based view. (Data neatly in CListView window, graphics in CScrollView window) How can I accomplish that? :confused: TIA -Marko
Yes, you need to use an addtional CMultiDocTemplate object:
pDocTemplate = new CMultiDocTemplate( IDR\_PGPCONTYPE, RUNTIME\_CLASS(CSGAControlDoc), RUNTIME\_CLASS(CChildFrame), // custom MDI child frame RUNTIME\_CLASS(CYourScrollView)); AddDocTemplate(pDocTemplate); pDocTemplate = new CMultiDocTemplate( IDR\_PGPCONTYPE, RUNTIME\_CLASS(CSGAControlDoc), RUNTIME\_CLASS(CChildFrame), // custom MDI child frame RUNTIME\_CLASS(CYourListView)); AddDocTemplate(pDocTemplate);
By default this will register 2 view types wit hteh same document. When you create the document you will be asked which type of view you want. To add the other view type, you will have to write a function thats adds the new view to the existing document. I did this a while back, but the code has since gone obselete in my app and has been deleted, so I don;t have any example code ready to hand. Roger Allen Sonork 100.10016 I have a terminal disease. Its called life!