Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

convert SDI to MDI - any shortcut

arvind17arvind17 Posts: 62Member
hi,
I have an application which is in the SDI format. Is there any simple format to convert the project to MDI.

Now, I have to create a new project MDI and paste all the necessary codes there fr the SDI project. Of course I find that a lenghly process and I would like to know if there is any simple way to do that. I understand that in MDI my appl will have to create Child Frame windows in addition to the Main Frame window.

regards
-arvind

Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    I read about this some time ago but can't find it now. So I created two test program -- an MFC SDI program and an MFC MDI program. Using the MDI program an the example, it wasn't very hard to convert the SDI to MDI.

    You have to create a new CChildFrame-based class, convert CMainFrame class from SDI to MDI, and change the .cpp (based on CWinApp) InitInstance() to create MDI template instead of SDI.

    [code]
    CMultiDocTemplate* pDocTemplate;
    pDocTemplate = new CMultiDocTemplate(
    IDR_MDITESTYPE,
    RUNTIME_CLASS(CSditestDoc),
    RUNTIME_CLASS(CChildFrame), // custom MDI child frame
    RUNTIME_CLASS(CSditestView));
    AddDocTemplate(pDocTemplate);

    //// NEW CODE BELOW ////
    // create main MDI Frame window
    CMainFrame* pMainFrame = new CMainFrame;
    if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
    return FALSE;
    m_pMainWnd = pMainFrame;
    /// end of new code /////
    [/code]


Sign In or Register to comment.