CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 1999
    Posts
    2

    from SDI to MDI ?

    Hi,

    I have a source code (MFC/C++) of an SDI application using the architect. Document/View. I want to
    convert this application to be MDI (Multiple document).,Is there any way to do this ?

    I modified the InitInstance of the applicatio, but this does not fix it.

    CTestApp::InitInstance()
    {
    ....
    ....
    ....
    CMultiDocTemplate* pDocTemplate;
    pDocTemplate = new CMultiDocTemplate(
    IDR_MAINFRAME,
    RUNTIME_CLASS(CTestDoc),
    RUNTIME_CLASS(CMainFrame), // main MDI frame window
    RUNTIME_CLASS(CTestView));
    AddDocTemplate(pDocTemplate);

    /* CSingleDocTemplate* pDocTemplate;
    pDocTemplate = new CSingleDocTemplate(
    IDR_MAINFRAME,
    RUNTIME_CLASS(CTestDoc),
    RUNTIME_CLASS(CMainFrame), // main SDI frame window
    RUNTIME_CLASS(CTestView));
    AddDocTemplate(pDocTemplate);*/
    ...
    ...
    ...
    }


    Thank you

    Jeff
    [email protected]


  2. #2
    Join Date
    May 1999
    Location
    Oregon, USA
    Posts
    302

    Re: from SDI to MDI ?

    Make sure CMainFrame is derived from CMDIFrameWnd.
    In an SDI app it is derived from CFrameWnd.
    One thing you can do is let the appwiz generate an MDI app
    for you and then make sure all of your docs and views and
    frames are derived correctly.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured