CEditView operation rediculously Slows down in Windows 7
-
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 ?
-
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 ?
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
-
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
-
Yes and at the same the logs can be saved as File for analysis purposes if at all if there is any issue.
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
-
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 ?
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
-
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
-
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
-
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.
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
-
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
-
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.
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
-
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