Re: Creating and Destyoying Dialog Box Continuosly.
- From: "voidcoder" <voidcoder@xxxxxxxxx>
- Date: Mon, 24 Apr 2006 09:46:42 +0200
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: Suresh D.Madhu
- Re: Creating and Destyoying Dialog Box Continuosly.
- References:
- Re: Creating and Destyoying Dialog Box Continuosly.
- From: voidcoder
- Re: Creating and Destyoying Dialog Box Continuosly.
- Prev by Date: Re: Creating and Destyoying Dialog Box Continuosly.
- Next by Date: CreateFileMapping and large memory area
- Previous by thread: Re: Creating and Destyoying Dialog Box Continuosly.
- Next by thread: Re: Creating and Destyoying Dialog Box Continuosly.
- Index(es):
Loading