Click to See Complete Forum and Search --> : class created and suddenlly hidden


Zolix2010
September 21st, 2005, 03:34 AM
hi,
i createed a class but the problem is that after a minute it close itself and the app.
this is my code:

TCHAR l_sClassName[100] = "InstallDialog";
TCHAR l_sTitle[100] = "iRadio Setup";
WNDCLASSEX l_WndClass;

l_WndClass.cbClsExtra = 0;
l_WndClass.cbWndExtra = 0;
l_WndClass.hInstance = m_hInstance;
l_WndClass.lpfnWndProc = (WNDPROC)DialogProc;
l_WndClass.lpszClassName = l_sClassName;
l_WndClass.style = CS_HREDRAW | CS_VREDRAW;
l_WndClass.hIcon = NULL;
l_WndClass.hIconSm = NULL;
l_WndClass.hCursor = NULL;
l_WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
l_WndClass.lpszMenuName = NULL;
l_WndClass.cbSize = sizeof(WNDCLASSEX);

ATOM l_RegClass = RegisterClassEx(&l_WndClass);


HWND l_hThis = CreateWindowEx(WS_EX_APPWINDOW,
l_sClassName,
l_sTitle,
WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
100,
120,
640,
480,
NULL,
NULL,
m_hInstance,
this);

if (l_hThis)
{
ShowWindow(l_hThis,1);
UpdateWindow(l_hThis);
}


what am i doing wrong?
Avi.

Zolix2010
September 21st, 2005, 03:38 AM
and the answer is!
i forgot to make a GetMessage loop in the winMain so the application just quit.

cheers all,
Avi. :wave: