Re: Creating and Destyoying Dialog Box Continuosly.
- From: Suresh D.Madhu <SureshDMadhu@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 24 Apr 2006 21:53:02 -0700
Thanks.
I ran the test for four hours and dumped the memorystatus for every 10
minutes.The result is as follows.
Time Available Physical Memory MemoryUsage(%)
0:00 46665728 10
0:30 45985792 12
1:00 45789138 12
1:30 45207522 13
2:00 44707840 14
2:30 44212224 15
3:00 43687936 16
3:30 43126784 17
4:00 42655774 18
4:30 42151936 19
5:00 41607168 20
5:30 41082880 21
6:00 40574976 22
Here afetrthe GUI is hanged and the memory status remains the same.
"voidcoder" wrote:
It still looks like a memory leak somewhere. Could you run a.
long playing test and dump the memory status every time you
are showing the dialog? Use GlobalMemoryStatus() API
to log the memory usage.
"Suresh D.Madhu" <SureshDMadhu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CB67F568-80C1-4BD2-BB58-C1E9272AF4F4@xxxxxxxxxxxxxxxx
I am explaining somewhat detail. The size of the screen is 1024 X 768 pixels.
I am creating one full screen window first. I am having other big dialog
boxes(with many buttons) in the top and bottom sections of that window. In
the middle section(x = 0, y = 150, width = 1024, height = 470) called graph
area, I am drawing some graphs. For drawing the graphs, I am getting the 9
bytepacket from serial port for every 10 ms. In the same packet itself I am
getting the alarm rising condition and also the alarm removing condition. if
I get the alarm rising condtion i need to show that alarm. If I get alarm
removing condition, I need to clear the alarm. Alarm will be showing in the
right most part of the grapharea from top to bottom, if there is an alarm ,
no need to dra the graphs on that alarm. But if there is no alarm I need to
draw the graph in that place also. At a time, I need to show maximum of 8
alarms. The width and height of the alarm is 100 and 50 pixels respectively.
(xThere is some gap between the alarms. There are totally 40 different types
of alarms. The user may access other dialog boxes at any time. All the
things are working perfectly in the normal case(with out creating alarms).
I am doing testing on that application. So I have taken the worst case in
which I can get either alarm rising conditioon or alarm removimg condition
for every packet. So I need to show or close the alarm dialog box for every
packet. But this is affecting the graph performance. So I tried for opening
and closing alarm dialog box for every 4 packets. It is not affecting graph
performance. But after four hours, I could not access other dialog boxes
except the graphs(tha graphs are always being plotting). And the alarm
dailog boxes are not created.
Is there any way to optimize the dialog box code to get it correct? or is
there any way to do it in a different way?
Thanks in advance.
"voidcoder" wrote:
Why do you need a !dialog! for that? Dialogs are intended for
somewhat else. Why not to use just a simple window?
Anyway, better approach would be to show the alarm
window (doalog) constantly and indicate the alarm by filling
the background from WM_TIMER handler every 40ms.
Eg.
int CMyAlarmPopupWindow::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
SetTimer(1, 40, NULL);
return 0;
}
void CMyAlarmPopupWindow::OnTimer(UINT nIDEvent)
{
const COLORREF colors[ 2 ] = { RGB(255, 0, 0}, RGB(0, 0, 255} };
static int counter = 0;
CRect rect;
GetClientRect(rect);
CDC * pDC = GetDC();
pDC->FillSolidRect(rect, colors[ counter & 1 ]);
ReleaseDC(pDC);
counter ++;
}
"Suresh D.Madhu" <SureshDMadhu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:36A710FA-9CA4-4504-BA4A-56242A13781B@xxxxxxxxxxxxxxxx
I am doing GUI application for medical equipment. In that, there may be the
chance for getting the alarm condition for every 10 ms(worst case). I am
getting this alarm condition through the serial port. While getting the alarm
condition, I need to display that particular alarm using dialog box with
different colors. This dialog box does not have any buttons and very small
also(100 X 50 pixels). Whenever the alarm condition is cleared by the medical
equipment, I need to close the alarm dialog box. This alarm cleared
information also I am getting through the serial port.
I am creating dialog box using CreateDialog API and I am closing it using
DestroyWindow API.
"voidcoder" wrote:
Possibly a memory leak somewhere in your code.
Give it a try with empty wizard generated dialog
and see if the problem is still there. Also how
do you close the dialog?
Btw is there any good reason why you need
to popup/destroy dialog every 40ms? Is it
usable for the end user?
"Suresh D.Madhu" <SureshDMadhu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:554E88AC-EC87-4817-99A9-A3ACA8169FE7@xxxxxxxxxxxxxxxx
Hi all,
I am doing WCE application in ICOP vortex-x86 Board. In that I am creating
and destroying a dialog box continuously(for every 40 ms). After some time,
It's hanging. I could not access other GUI parts. Can anybody explain me why
it happens? Can anybody help to solve this problem?
Thanks in advance.
- Follow-Ups:
- Re: Creating and Destyoying Dialog Box Continuosly.
- From: voidcoder
- Re: Creating and Destyoying Dialog Box Continuosly.
- References:
- Re: Creating and Destyoying Dialog Box Continuosly.
- From: voidcoder
- Re: Creating and Destyoying Dialog Box Continuosly.
- From: voidcoder
- Re: Creating and Destyoying Dialog Box Continuosly.
- From: Suresh D.Madhu
- Re: Creating and Destyoying Dialog Box Continuosly.
- From: voidcoder
- Re: Creating and Destyoying Dialog Box Continuosly.
- Prev by Date: Extending Non Client Array of a control
- Next by Date: Re: Ringtone setting WINCE 5.0
- Previous by thread: Re: Creating and Destyoying Dialog Box Continuosly.
- Next by thread: Re: Creating and Destyoying Dialog Box Continuosly.
- Index(es):
Relevant Pages
|