CompuServe Messages

Creating New Document

    10-Jul-94 18:11:01
Sb: Creating New Document
Fm: Tarn Faulkner [MSFT] 73764,3260
To: Robin Collins 100015,416
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