Click to See Complete Forum and Search --> : CWnd Problem


wky086
January 8th, 2001, 12:24 AM
Hi:
Here have a problem to ask for opinion.
There has a program used for collection information with the following GUI.
*********************************************
*----- Tab View ( 4 Tab)-- *-List View------*
*********************************************
*---------------List View ------------------*
*********************************************

this program use Com port to receive data and dispaly in the sub-Tab window. And use RichEditCtrl to
control display data. It can store maximum 2 MByte of data in each Tab.
It delete 1/3 of maximum length of data when it exceed this limit.(method: SetSel(0,DataLEN/3),ReplaceSel(""))
It work on PetuimII MMX 233. 128M Ram COMPAQ computer.
It work perfectly at above situation.

When I add one more tab and two more Comport to receive data. it has problem.
An abnormal situation comes out.
The COM port new added did not receive data and did not been initialized.The program use 100% of CPU for ten two
hundred of seconds sometimes. maybr once a day or once two day.
I trace the process time in some block of program. I found that it paused at method SetSel("0,MAXLEN/3)
the MAXLEN is 2000000 byte, I derease it to 200000 byte. The Set Sel(0,8000);It works OK.
Question1 : I am not sure does this solve the problem or hide the problem.
Question2 : If it solved the problem. Two conclusion can be made.
1) Add one more tab ( form 4 to 5) will make SetSel(0,DataLEN/3) sometimes process
a long time and use 100% of CPU.
2) Decrease the size of day displayed in the window from 200000 to 200000 and
SetSel() from 2xxxxxx/3 to 8000 will solve the problem.
But the point is how can add only one tab have this big affect? And
Reduce size can solve this problem, but from the performance monitor there have not problem
on memory.If Add RAM , can it be solved??
SetSel() is a standard command of CWnd.
Does it related to CWnd processing of multiple tab.
Anybody have suggestion about this situation. It will be very helpful.




wky086