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. Initialization part in SDI MFC project.

Initialization part in SDI MFC project.

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
5 Posts 3 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.
  • T Offline
    T Offline
    tingu
    wrote on last edited by
    #1

    Hi, I am changing my dialog based MFC application to SDI application. I have the initialization code in TestDlg::OnInitDialog(), in the part //TODO: Add extra initialization here What is the equivalent function in SDI? Where can I add this extra initialization? I see CAppView::OnInitalUpdate() function, but there isn't //TODO: Add extra initialization here comment. Thanks, Harsha

    D V 2 Replies Last reply
    0
    • T tingu

      Hi, I am changing my dialog based MFC application to SDI application. I have the initialization code in TestDlg::OnInitDialog(), in the part //TODO: Add extra initialization here What is the equivalent function in SDI? Where can I add this extra initialization? I see CAppView::OnInitalUpdate() function, but there isn't //TODO: Add extra initialization here comment. Thanks, Harsha

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      One such place is the document's OnOpenDocument() method, or the view's OnInitialUpdate() method. It really just depends on what it is that you are initializing.


      "The largest fire starts but with the smallest spark." - David Crow

      "Judge not by the eye but by the heart." - Native American Proverb

      T 1 Reply Last reply
      0
      • T tingu

        Hi, I am changing my dialog based MFC application to SDI application. I have the initialization code in TestDlg::OnInitDialog(), in the part //TODO: Add extra initialization here What is the equivalent function in SDI? Where can I add this extra initialization? I see CAppView::OnInitalUpdate() function, but there isn't //TODO: Add extra initialization here comment. Thanks, Harsha

        V Offline
        V Offline
        Viorel
        wrote on last edited by
        #3

        I think you can do this in CChildView::OnCreate handler for WM_CREATE notification.

        1 Reply Last reply
        0
        • D David Crow

          One such place is the document's OnOpenDocument() method, or the view's OnInitialUpdate() method. It really just depends on what it is that you are initializing.


          "The largest fire starts but with the smallest spark." - David Crow

          "Judge not by the eye but by the heart." - Native American Proverb

          T Offline
          T Offline
          tingu
          wrote on last edited by
          #4

          Hi, Thank you. I am adding the initialization code related to the controls I have added on IDD_APP_FORM (Dialog). So I guess I should add initialization code to view's OnInitialUpdate() method. In which case document's OnOpenDocument() method is used? Thanks, Harsha

          D 1 Reply Last reply
          0
          • T tingu

            Hi, Thank you. I am adding the initialization code related to the controls I have added on IDD_APP_FORM (Dialog). So I guess I should add initialization code to view's OnInitialUpdate() method. In which case document's OnOpenDocument() method is used? Thanks, Harsha

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            harsha1305 wrote:

            In which case document's OnOpenDocument() method is used?

            When you want to reinitialize the existing CDocument object, rather than create a new one.


            "The largest fire starts but with the smallest spark." - David Crow

            "Judge not by the eye but by the heart." - Native American Proverb

            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