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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Document template problem

Document template problem

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++help
3 Posts 2 Posters 1 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
    dolph_loe
    wrote on last edited by
    #1

    HI! In my code, I create a document template in the following way:

    pDocTemplate = new CMultiDocTemplate(IDR_PHYSEDIT,
    RUNTIME_CLASS(CPhysEditDoc),
    RUNTIME_CLASS(CPhysEditFrame),
    RUNTIME_CLASS(CPhysEditView));
    if (!pDocTemplate)
    return FALSE;
    AddDocTemplate(pDocTemplate);

    Everything works perfectly, but when the program exits I get the following output: e:\work\c++\project\utilities.cpp(117) : {58} client block at 0x003F4B40, subtype c0, 140 bytes long. a CMultiDocTemplate object at $003F4B40, 140 bytes long {56} normal block at 0x003F49F8, 78 bytes long. Data: < 6 = = > D0 0D 36 10 3D 00 00 00 3D 00 00 00 01 00 00 00 My question is: How do I clean up the document template objects on exit? Shouldn't CWinApp do that? øivind

    T 1 Reply Last reply
    0
    • D dolph_loe

      HI! In my code, I create a document template in the following way:

      pDocTemplate = new CMultiDocTemplate(IDR_PHYSEDIT,
      RUNTIME_CLASS(CPhysEditDoc),
      RUNTIME_CLASS(CPhysEditFrame),
      RUNTIME_CLASS(CPhysEditView));
      if (!pDocTemplate)
      return FALSE;
      AddDocTemplate(pDocTemplate);

      Everything works perfectly, but when the program exits I get the following output: e:\work\c++\project\utilities.cpp(117) : {58} client block at 0x003F4B40, subtype c0, 140 bytes long. a CMultiDocTemplate object at $003F4B40, 140 bytes long {56} normal block at 0x003F49F8, 78 bytes long. Data: < 6 = = > D0 0D 36 10 3D 00 00 00 3D 00 00 00 01 00 00 00 My question is: How do I clean up the document template objects on exit? Shouldn't CWinApp do that? øivind

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

      dolph_loe wrote: My question is: How do I clean up the document template objects on exit? Shouldn't CWinApp do that? You don't. CYourApp will delete the doc template object in its destructor. Can you set the breakpoint in your app destructor and step into CWinApp::~CWinApp from there? Tomasz Sowinski -- http://www.shooltz.com

      Alika masiaka!

      D 1 Reply Last reply
      0
      • T Tomasz Sowinski

        dolph_loe wrote: My question is: How do I clean up the document template objects on exit? Shouldn't CWinApp do that? You don't. CYourApp will delete the doc template object in its destructor. Can you set the breakpoint in your app destructor and step into CWinApp::~CWinApp from there? Tomasz Sowinski -- http://www.shooltz.com

        Alika masiaka!

        D Offline
        D Offline
        dolph_loe
        wrote on last edited by
        #3

        tnx! had to add the following line

        pDocTemplate->m_bAutoDelete = true;

        :) øivind

        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