Thread: changing from multiple-doc to single-doc

  1. #1
    swordfish
    Guest

    Question changing from multiple-doc to single-doc

    I have created a program using mfc wizard in visual c++ 6 and chose the multiple-document option but now want to change it so it's only a single-document application. Do you know how to do this?

  2. #2
    Barjor
    Guest
    Ok this isn't really a big help but the only way I have been able to do it is to use the appwizard to create a new SDI.Recreate all classes..etc, and then start to copy & paste all your user created code from the MDI. Not very graciuos but it works.
    ~Barjor

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    223

    changing a MDI to an SDI app

    I looked this up in the help files before and that is how it instructed to do it. Here are the main differences that I can remember from an SDI and a MDI app..
    CMainFrame is derived from CMainWnd --- change to this in CMainFrm.h
    CMainFrame is derived from CMDIWnd
    Lose the CChildFrame.cpp and CChildFrame.h files
    lose the #include "ChildFrame.h" in the C..App.h
    in the C..App.cpp modify the InitInstance function
    declare a CSingleDocTemplate instead of a CMultiDocTemplate
    Delete the code segment that creates the MDI Frame Window
    // create main MDI Frame window
    CMainFrame* pMainFrame = new CMainFrame;
    if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
    return FALSE;
    m_pMainWnd = pMainFrame;

    You can expect to run into some errors but you should be able to do it the way barjor said.
    zMan

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linker errors - Multiple Source files
    By nkhambal in forum C Programming
    Replies: 3
    Last Post: 04-24-2005, 02:41 AM
  2. Writing to single file in multiple functions
    By alvision in forum C Programming
    Replies: 12
    Last Post: 08-22-2004, 08:15 PM
  3. Single taskbar icon, multiple windows
    By Dark Nemesis in forum Windows Programming
    Replies: 5
    Last Post: 12-25-2003, 09:39 PM
  4. Replies: 1
    Last Post: 05-01-2003, 02:52 PM
  5. Single API for multiple CGI
    By Unregistered in forum Linux Programming
    Replies: 1
    Last Post: 10-09-2001, 06:31 AM