Solved

Multiple document templates use

Posted on 1998-06-02
2
146 Views
Last Modified: 2012-05-04
I have an MDI application that is using multiple FormViews
as the documents.  I know how to associate the templates
with the document and mainframe classes using the RUNTIME
MACRO.  Right now if I click on new I get a VC++ generated
Input Box asking me which form to load.  How can I load one of
these forms with the selection of an item from a menu or the click
of a button.  The application is menu driven, and I need to load a
corresponding form according to the user selection.

Thank-you -- jr
0
Comment
Question by:jrmcg
  • 2
2 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 100 total points
ID: 1165114
You'll need to write your own handler for the File/New (or the individual menu choices you want for each specific doc type, like "New Chart" or "New Sheet").

In there, just use a pointer to the doc template to call OpenDocumentFile() on the template you want to use. Pass NULL to create a new file, or pass a fully qualified path to serialiez from that particular file.

.B ekiM

0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1165115
Please see the PICKNEW.ZIP sample at http://www.nwlink.com/~mikeblas/samples/.

.B ekiM
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now