|
-
August 26th, 1999, 11:56 AM
#1
Creating a new document
Hi
I have an MDI in which I have a menu item that opens up a dialog box. In this dialog box some information is entered and I want this information to be displayed in a new document. As it is now I can do all of this except for opening the new document window. Is it possible to open a new document window from the dialog box and then display the information in this document?
Urban
-
August 26th, 1999, 01:52 PM
#2
Re: Creating a new document
A Quick and dirty way is to set a flag someplace, store the data someplace, and trigger OnFileNew(). When the new view constructs, have it check the flag, and if the flag is set, have it get the stored data, use it, and then unset the flag.
-=- James.
-=- James.
-
August 30th, 1999, 03:19 AM
#3
Re: Creating a new document
1.Send WM_COMMAND (ID_FILE_NEW)to MDIFrameWnd.
2. Send WM_COPYDATA with string to MDIFrameWnd.
3.In MDIFrameWnd repost this message to all ChildFrames.
4.In the Doc class I suppose you have to have CString member to hold string from dialog,which should be empty.
5.In Your ChildFrame class enter handle for WM_COPYDATA,which should test if the relevant Doc class has empty string member - and if it has - set it to new (received with message).
6.View will output the string from relevant Doc,in usual way(using TextOut for instance).
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
|