sparafucile17
Programmer
I have a MDI that I would like to use with multiple views. For the most part the views will be CFormViews. What I'd like my app to do is to load a different view for each menu item.
In my app, I have a Menu titled "Membership". Under this menu I have two items: Add New, View All. I want each item to launch it's own specific CFormView as a child window. There will be a DB thread running all the time to add/view the data, so I'm not really concerned about using any documents at this time. (perhaps later for reporting...)
I found the way to add multiple view to my app similar to the following method (MSDN Example):
m_pBookViewTemplate = new CMultiDocTemplate(IDR_BOOKFRAME,
RUNTIME_CLASS(CChkBookDoc),
RUNTIME_CLASS(CCheckBookFrame),
RUNTIME_CLASS(CBookView));
AddDocTemplate(m_pBookViewTemplate);
m_pCheckViewTemplate = new CMultiDocTemplate(IDR_CHECKFRAME,
RUNTIME_CLASS(CChkBookDoc),
RUNTIME_CLASS(CCheckBookFrame),
RUNTIME_CLASS(CCheckView));
AddDocTemplate(m_pCheckViewTemplate);
But here's the catch: It always loads a dialog box that makes you select which view you want! But I already know what view I want, because the user already selected it by choosing the appropriate menu item!
Is there anyway to bypass this view-selection dialog? Or other suggestion for how to use multiple views? Any help would be greatly appreciated.
Jeff
In my app, I have a Menu titled "Membership". Under this menu I have two items: Add New, View All. I want each item to launch it's own specific CFormView as a child window. There will be a DB thread running all the time to add/view the data, so I'm not really concerned about using any documents at this time. (perhaps later for reporting...)
I found the way to add multiple view to my app similar to the following method (MSDN Example):
m_pBookViewTemplate = new CMultiDocTemplate(IDR_BOOKFRAME,
RUNTIME_CLASS(CChkBookDoc),
RUNTIME_CLASS(CCheckBookFrame),
RUNTIME_CLASS(CBookView));
AddDocTemplate(m_pBookViewTemplate);
m_pCheckViewTemplate = new CMultiDocTemplate(IDR_CHECKFRAME,
RUNTIME_CLASS(CChkBookDoc),
RUNTIME_CLASS(CCheckBookFrame),
RUNTIME_CLASS(CCheckView));
AddDocTemplate(m_pCheckViewTemplate);
But here's the catch: It always loads a dialog box that makes you select which view you want! But I already know what view I want, because the user already selected it by choosing the appropriate menu item!
Is there anyway to bypass this view-selection dialog? Or other suggestion for how to use multiple views? Any help would be greatly appreciated.
Jeff