Click here to Skip to main content
Licence 
First Posted 25 Feb 2004
Views 33,759
Bookmarked 13 times

Zero or One Document Interface (ZODI)

By | 25 Feb 2004 | Article
This article describes how to create a single-document application using multi-document interface. You may have zero or one document at a time.

What's this?

This article describes how to create a single-document application using multi-document interface. You may have zero or one document at a time.

I've written a CMultiDocTemplate - derived class CZoDocTemplate. It overrides OpenDocumentFile function. OpenDocumentFile works like CSingleDocTemplate one. It reinitializes created document instead of creating one more document. If there is no opened document, new document is created like in MDI case. If you create several document templates, you will have maximum one document per each template.

To create your own ZODI application

  1. Create MDI application with AppWizard.
  2. Add ZoDocTemplate.h & ZoDocTemplate.cpp in your project, named <your app>.
  3. Include ZoDocTemplate.h in <your app>.cpp.
  4. In InitInstance function, replace
        CMultiDocTemplate* pDocTemplate;
        pDocTemplate = new CMultiDocTemplate(...);

    with

        CZoDocTemplate* pDocTemplate;
        pDocTemplate = new CZoDocTemplate(...);

Similar Article

Here is a similar article: Single View in MultiDoc-Application. I present another more simpler way of "Single View in MultiDoc-Application" implementation. In ZODI, the existing document is reinitialized like in SDI case.

History

Date posted: February 18, 2004.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Constructor

Software Developer (Senior)
Mirantis
Russian Federation Russian Federation

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralOpening New Docs PinmemberTim Gard15:37 29 Jun '05  
GeneralRe: Opening New Docs PinmemberConstructor22:38 7 Jul '05  
GeneralRe: Opening New Docs PinmemberTim Gard7:38 8 Jul '05  
GeneralC++ makes bad HTML PinmemberTim Gard19:26 13 Jul '05  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 26 Feb 2004
Article Copyright 2004 by Constructor
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid