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. New SDI (Doc formview frame) from an existing one.

New SDI (Doc formview frame) from an existing one.

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 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.
  • _ Offline
    _ Offline
    _T No name
    wrote on last edited by
    #1

    i want a new SDI(view derived from CFormView) to be launched from existing one. On a button click event i did this. CWnd* pTmpMainWnd = theApp.m_pMainWnd; CSingleDocTemplate* pDocSOTemplate; pDocSOTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CSaveImageOptionDoc), RUNTIME_CLASS(CSaveImageOptionFrame), RUNTIME_CLASS(CSaveImageOptionView)); theApp.AddDocTemplate(pDocSOTemplate); theApp.m_pMainWnd = NULL; pDocSOTemplate->OpenDocumentFile(NULL, FALSE); ASSERT_KINDOF(CSaveImageOptionFrame, theApp.m_pMainWnd); CSaveImageOptionFrame* pMainFrame = static_cast<CSaveImageOptionFrame*>(theApp.m_pMainWnd); theApp.m_pMainWnd = pTmpMainWnd; pMainFrame->ShowWindow(SW_SHOWNORMAL); pMainFrame->CenterWindow(pTmpMainWnd); CSaveImageOption(fram/doc/view) is new SDI i want to creat. in new SDI view i have IDD = IDD_DIALOG wwhich is valid dialog. with DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU ita crashes on CFormView :: CFormView () ASSERT_VALID_IDR(nIDTemplate) where nIDTemplate is my IDD_DIALOG i have passed. i knw this may nt be enought info but if nyone has ny idea plz help/

    I 1 Reply Last reply
    0
    • _ _T No name

      i want a new SDI(view derived from CFormView) to be launched from existing one. On a button click event i did this. CWnd* pTmpMainWnd = theApp.m_pMainWnd; CSingleDocTemplate* pDocSOTemplate; pDocSOTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CSaveImageOptionDoc), RUNTIME_CLASS(CSaveImageOptionFrame), RUNTIME_CLASS(CSaveImageOptionView)); theApp.AddDocTemplate(pDocSOTemplate); theApp.m_pMainWnd = NULL; pDocSOTemplate->OpenDocumentFile(NULL, FALSE); ASSERT_KINDOF(CSaveImageOptionFrame, theApp.m_pMainWnd); CSaveImageOptionFrame* pMainFrame = static_cast<CSaveImageOptionFrame*>(theApp.m_pMainWnd); theApp.m_pMainWnd = pTmpMainWnd; pMainFrame->ShowWindow(SW_SHOWNORMAL); pMainFrame->CenterWindow(pTmpMainWnd); CSaveImageOption(fram/doc/view) is new SDI i want to creat. in new SDI view i have IDD = IDD_DIALOG wwhich is valid dialog. with DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU ita crashes on CFormView :: CFormView () ASSERT_VALID_IDR(nIDTemplate) where nIDTemplate is my IDD_DIALOG i have passed. i knw this may nt be enought info but if nyone has ny idea plz help/

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      I would suggest making a new blank project using appwizard - and make sure that compiles nicely. Then start changing things little by little. Not a very exciting answer, but you should learn a lot in the process! Good luck, Iain.

      Codeproject MVP for C++, I can't believe it's for my lounge posts...

      _ 1 Reply Last reply
      0
      • I Iain Clarke Warrior Programmer

        I would suggest making a new blank project using appwizard - and make sure that compiles nicely. Then start changing things little by little. Not a very exciting answer, but you should learn a lot in the process! Good luck, Iain.

        Codeproject MVP for C++, I can't believe it's for my lounge posts...

        _ Offline
        _ Offline
        _T No name
        wrote on last edited by
        #3

        well i did the same way... i made a new sample application and copied files of those in my project. i have comapred the applicaion main file of both the projects also. but nt able to find nything... it says something wrong with the dialog while creating veiew i dnt knw why

        I 1 Reply Last reply
        0
        • _ _T No name

          well i did the same way... i made a new sample application and copied files of those in my project. i have comapred the applicaion main file of both the projects also. but nt able to find nything... it says something wrong with the dialog while creating veiew i dnt knw why

          I Offline
          I Offline
          Iain Clarke Warrior Programmer
          wrote on last edited by
          #4

          Set the no-fail-create style on the dialog, which helps a LOT for diagnosing dialog problems. Are you adding any odd controls? ActiveX thingies? Iain.

          Codeproject MVP for C++, I can't believe it's for my lounge posts...

          _ 1 Reply Last reply
          0
          • I Iain Clarke Warrior Programmer

            Set the no-fail-create style on the dialog, which helps a LOT for diagnosing dialog problems. Are you adding any odd controls? ActiveX thingies? Iain.

            Codeproject MVP for C++, I can't believe it's for my lounge posts...

            _ Offline
            _ Offline
            _T No name
            wrote on last edited by
            #5

            no i m nt adding ny of these controls. do i need to create the dialog seperately before i initiale that new SDI application.

            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