|
-
September 3rd, 1999, 10:11 AM
#1
How to open different document templates using button messages?
Hello all,
Perhaps the answer to this question may be found in some FAQ somewhere,
but I could not locate a simple answer yet.
I want to create more than one document template and open a specific one if the user selects a toolbar button; I don't want the program to display the File type dialog box. I had once learned how to bypass the dialog, but never found out how to start up a certain doc type depending on a button message.
Does anyone know where I should answer the toolbar message and what steps I should take to create/open a certain doc type?
Sincerely,
Hurol Aslan
-
September 6th, 1999, 03:52 AM
#2
Re: How to open different document templates using button messages?
Hi,
Try this:
1.Add these lines to your CWinApp derived:
CMultiDocTemplate *pTemplate1;
CMultiDocTemplate *pTemplate2;
..
CMultiDocTemplate *pTemplateN;
;
2.In your InitInstance "init" these pointers:
pTemplate1=new CMultiDocTemplate(..);
pTemplate2=new CMultiDocTemplate(..);
...
pTemplateN=new CMultiDocTemplate(..);
and delete the line wit ProcessShellCommand call.
3.Create handlers for your toolbar buttons in which create empty documents:
pTemplate1->OpenDocumentFile(NULL);
...
Good luck,Oleg.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|