Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. different MDI Child opening same file

different MDI Child opening same file

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DerekSaw
    wrote on last edited by
    #1

    It seems that MFC don't allow me to open documents with the same name...... I JUST WANT to have my MDI apps able to *open* and read multiple documents with the same name...i.e. my OnOpenDocument() will be called everytime even if i'm opening another file with the same name... I don't want them to have views sharing the same doc... because at later time I'm going to add different things into all of them.... and maybe have them output data eg. filename.001 for view 1, filename.002 for view 2..... Pls help.

    T 1 Reply Last reply
    0
    • D DerekSaw

      It seems that MFC don't allow me to open documents with the same name...... I JUST WANT to have my MDI apps able to *open* and read multiple documents with the same name...i.e. my OnOpenDocument() will be called everytime even if i'm opening another file with the same name... I don't want them to have views sharing the same doc... because at later time I'm going to add different things into all of them.... and maybe have them output data eg. filename.001 for view 1, filename.002 for view 2..... Pls help.

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      The code you want to change is located in the CDocManager MFC class; its virtual function OpenDocumentFile checks if document is already open. You'd have to derive CYourDocManager and change the OpenDocumentFile method. KB article Q198538 has sample which reportedly uses its own CDocManager to provide multiple extensions for one doc type. Tomasz Sowinski -- http://www.shooltz.com

      What is "scratch" and why can everything be made from it?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups