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. CEditView operation rediculously Slows down in Windows 7

CEditView operation rediculously Slows down in Windows 7

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
11 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.
  • V Vijjuuu

    I have a MFC MDI (logging) application developed in VS2005 in Windows XP which gets logs from another Process(using pipes) and logs them into view. i have a View derived from CEditView. There is so much of logging is done to MFC application for every sec and works good in XP. when the same application is running in Windows 7. initally it seems to be good but when the logging data is becoming more and more we can se the MFC application is logging data very slowly when compared to XP. On analysis it was found that operation on Edit Ctrl is making the logging slow these are the line of code which is making the application slow . int nLen = GetWindowTextLength(); GetEditCtrl().SetSel(nLen,nLen); // tested GetEditCtrl().SetSel(-1,-1); as well GetEditCtrl().ReplaceSel(strTemp); // strTemp is the Cstring data which is read from pipe Is there any better way to make application not to get slow in Window 7 ?

    L Offline
    L Offline
    Lost User
    wrote on last edited by
    #2

    If this is a logging system why are you using an edit control; do you expect the user to be able to change the content?

    Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

    V 1 Reply Last reply
    0
    • L Lost User

      If this is a logging system why are you using an edit control; do you expect the user to be able to change the content?

      Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

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

      Yes and at the same the logs can be saved as File for analysis purposes if at all if there is any issue.

      L 1 Reply Last reply
      0
      • V Vijjuuu

        Yes and at the same the logs can be saved as File for analysis purposes if at all if there is any issue.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #4

        Well you are stuck with slow processing because as the edit control grows in size it will become slower to manage and display. Using a simple CScrollView would be a much better choice.

        Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

        V 1 Reply Last reply
        0
        • V Vijjuuu

          I have a MFC MDI (logging) application developed in VS2005 in Windows XP which gets logs from another Process(using pipes) and logs them into view. i have a View derived from CEditView. There is so much of logging is done to MFC application for every sec and works good in XP. when the same application is running in Windows 7. initally it seems to be good but when the logging data is becoming more and more we can se the MFC application is logging data very slowly when compared to XP. On analysis it was found that operation on Edit Ctrl is making the logging slow these are the line of code which is making the application slow . int nLen = GetWindowTextLength(); GetEditCtrl().SetSel(nLen,nLen); // tested GetEditCtrl().SetSel(-1,-1); as well GetEditCtrl().ReplaceSel(strTemp); // strTemp is the Cstring data which is read from pipe Is there any better way to make application not to get slow in Window 7 ?

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

          As an alternative, see here.

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

          V 1 Reply Last reply
          0
          • D David Crow

            As an alternative, see here.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

            V Offline
            V Offline
            Vijjuuu
            wrote on last edited by
            #6

            Thanks David. My MFC Application is very old application which is we are using for years. Dont want to change any class inheritances. except to find an alternative to solve the issue.

            D 1 Reply Last reply
            0
            • L Lost User

              Well you are stuck with slow processing because as the edit control grows in size it will become slower to manage and display. Using a simple CScrollView would be a much better choice.

              Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

              V Offline
              V Offline
              Vijjuuu
              wrote on last edited by
              #7

              Thanks Richard. My MFC Application is very old application which is we are using for years. Dont want to change any class inheritances. except to find an alternative to solve the issue.

              L 1 Reply Last reply
              0
              • V Vijjuuu

                Thanks David. My MFC Application is very old application which is we are using for years. Dont want to change any class inheritances. except to find an alternative to solve the issue.

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

                Another solution might be to separate the logging from the data acquisition. In other words, instead of receiving data from the pipe(s) and immedialtely log it to a control, how about adding the data to some type of container (e.g., string, vector, list) and let the edit control update itself from that container in a separate thread?

                "One man's wage rise is another man's price increase." - Harold Wilson

                "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

                V 1 Reply Last reply
                0
                • D David Crow

                  Another solution might be to separate the logging from the data acquisition. In other words, instead of receiving data from the pipe(s) and immedialtely log it to a control, how about adding the data to some type of container (e.g., string, vector, list) and let the edit control update itself from that container in a separate thread?

                  "One man's wage rise is another man's price increase." - Harold Wilson

                  "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                  "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

                  V Offline
                  V Offline
                  Vijjuuu
                  wrote on last edited by
                  #9

                  Ya i tried that as well but that making my application more slow :(.

                  1 Reply Last reply
                  0
                  • V Vijjuuu

                    Thanks Richard. My MFC Application is very old application which is we are using for years. Dont want to change any class inheritances. except to find an alternative to solve the issue.

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #10

                    Vijjuuu. wrote:

                    Dont want to change any class inheritances.

                    Well I'm afraid you are stuck with the problem, unless you can figure out some way to speed up your edit control updates.

                    Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

                    V 1 Reply Last reply
                    0
                    • L Lost User

                      Vijjuuu. wrote:

                      Dont want to change any class inheritances.

                      Well I'm afraid you are stuck with the problem, unless you can figure out some way to speed up your edit control updates.

                      Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

                      V Offline
                      V Offline
                      Vijjuuu
                      wrote on last edited by
                      #11

                      Yes i am stuck :( Thanks for your time for replying.

                      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