CompuServe Thread

Creating New Document

1 messages in this thread
#30427From: Tarn Faulkner [MSFT]Jul 10, 1994 6:11 PM
Robin, >> In an MDI app. I want to open a new document but load it by means other than reading a document: eg. pasting from the clipboard, scanning an image etc. I've got it working by setting a public flag in my CWinApp object and then calling the OnNewDocument() member of my derived CDocument. This in turn checks the flag and performs the necessary actions. This use of a flag doesn't 'feel right' somehow (to someone new to OOP) and I wonder if there's a better way to do this. << You can also save your CMultiDocTemplate pointers which you pass to AddDocTemplate in your InitInstance. Through these pointers you can call OpenDocumentFile() passing it NULL to create a new document (with no file associated yet) or a file name to load. OpenDocumentFile is one of the useful but undocumented functions which we're working to get into the next version of the documentation. Hope this helps. Tarn Faulkner Microsoft Developer Support