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. Application gets slower when having ~50 dialogs in memory.

Application gets slower when having ~50 dialogs in memory.

Scheduled Pinned Locked Moved C / C++ / MFC
jsonperformancehelpquestion
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.
  • P Offline
    P Offline
    Paresh Chitte
    wrote on last edited by
    #1

    Hi, I have an MDI application. In view, I have created a property sheet. In one of the pages of this property sheet, I have to create ~50 different kinds of modeless dialogs, owned by property page. All these dialogs are needed in memory as long as the document is open in the session. I have created them at application start up. However, when I create two to three documents, my application gets very slow (~50 * 3 documents = ~150 dialogs in memory). The API CDialog::Create is taking time. Could you please suggest a solution for this ? Any help would be highly appreciated. Regards, Paresh.

    Steve EcholsS 1 Reply Last reply
    0
    • P Paresh Chitte

      Hi, I have an MDI application. In view, I have created a property sheet. In one of the pages of this property sheet, I have to create ~50 different kinds of modeless dialogs, owned by property page. All these dialogs are needed in memory as long as the document is open in the session. I have created them at application start up. However, when I create two to three documents, my application gets very slow (~50 * 3 documents = ~150 dialogs in memory). The API CDialog::Create is taking time. Could you please suggest a solution for this ? Any help would be highly appreciated. Regards, Paresh.

      Steve EcholsS Offline
      Steve EcholsS Offline
      Steve Echols
      wrote on last edited by
      #2

      Can each document share the dialogs, so you only have to create 50? Why not create each dialog dynamically when it's needed, or are all 50 visible all the time. Sounds like a pretty intense app if that's the case. Could combine some of the dialogs?


      - S 50 cups of coffee and you know it's on!

      • S
        50 cups of coffee and you know it's on!
        Code, follow, or get out of the way.
      P 1 Reply Last reply
      0
      • Steve EcholsS Steve Echols

        Can each document share the dialogs, so you only have to create 50? Why not create each dialog dynamically when it's needed, or are all 50 visible all the time. Sounds like a pretty intense app if that's the case. Could combine some of the dialogs?


        - S 50 cups of coffee and you know it's on!

        P Offline
        P Offline
        Paresh Chitte
        wrote on last edited by
        #3

        Hi Steve, Thanks for your reply.

        Steve Echols wrote:

        Can each document share the dialogs, so you only have to create 50?

        A particlaur dialog has its own data. A data in a dialog in one document is different from another dialog from another document. Could you please let me know, How could I share the dialogs across two documents ?

        Steve Echols wrote:

        Why not create each dialog dynamically when it's needed, or are all 50 visible all the time.

        Then also application gets slow. Regards, Paresh.

        N 1 Reply Last reply
        0
        • P Paresh Chitte

          Hi Steve, Thanks for your reply.

          Steve Echols wrote:

          Can each document share the dialogs, so you only have to create 50?

          A particlaur dialog has its own data. A data in a dialog in one document is different from another dialog from another document. Could you please let me know, How could I share the dialogs across two documents ?

          Steve Echols wrote:

          Why not create each dialog dynamically when it's needed, or are all 50 visible all the time.

          Then also application gets slow. Regards, Paresh.

          N Offline
          N Offline
          Nelek
          wrote on last edited by
          #4

          I had the same problem when creating the parameter-dialogs for each element, when I had 20+ elements and tryed to open them the app was freezing. I got it improved by removing the CDialogs and using CFormViews, duplicating the views as I needed them. It gives more performance, more speed and more functionality (i.e. UpdateAllViews ()).

          Paresh Chitte wrote:

          How could I share the dialogs across two documents ?

          At the same time you are not going to be able of that. If you open the window for a document you should close it and reopen for another document. Or delete the contents of all elements and then fill them with the datas of the second element. I made it adding a CMyDoc* pointer to the "parent" document as member variable in the CFormView, when I double-clicked on an element to be parametrized, then I got the document pointer in the CMyView and sent it to the CFormView of that element at the end of the opening process. Then used the OnInitialUpdate () to fill all the elements with the datas of the document. You can check this[^] and this[^] posts to have a look of what I made. Hope it helps :)

          Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson

          P 1 Reply Last reply
          0
          • N Nelek

            I had the same problem when creating the parameter-dialogs for each element, when I had 20+ elements and tryed to open them the app was freezing. I got it improved by removing the CDialogs and using CFormViews, duplicating the views as I needed them. It gives more performance, more speed and more functionality (i.e. UpdateAllViews ()).

            Paresh Chitte wrote:

            How could I share the dialogs across two documents ?

            At the same time you are not going to be able of that. If you open the window for a document you should close it and reopen for another document. Or delete the contents of all elements and then fill them with the datas of the second element. I made it adding a CMyDoc* pointer to the "parent" document as member variable in the CFormView, when I double-clicked on an element to be parametrized, then I got the document pointer in the CMyView and sent it to the CFormView of that element at the end of the opening process. Then used the OnInitialUpdate () to fill all the elements with the datas of the document. You can check this[^] and this[^] posts to have a look of what I made. Hope it helps :)

            Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson

            P Offline
            P Offline
            Paresh Chitte
            wrote on last edited by
            #5

            Hi Nelek, Thanks for your reply. I will look into it. Regards, Paresh.

            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