Zachary Turner
2005-01-26 16:43:36 UTC
I am trying to create a modeless dialog that all it does is display a
static text field (I'm using ATL dialogs actually, but it maps straight
down to Windows API calls). Anyway my code is something like the
following:
CMyDialog dlg;
dlg.Create(hwndParent);
dlg.ShowWindow(SW_SHOW);
Sleep(2000):
dlg.ShowWindow(SW_HIDE);
dlg.DestroyWindow();
Now, the dialog shows up fine and I can see the title bar. However,
the static text field is not visible. If, on the other hand, I execute
the code:
CMyDialog dlg;
dlg.DoModal(hwndParent);
then I can see the static text field and the dialog displays perfectly.
My code is simple enough that I have a feeling this is just one of
those common mistakes that everyon mistakes at least once, but I can't
figure out what it is. Does anybody have an idea what could be going
wrong? Thank you.
static text field (I'm using ATL dialogs actually, but it maps straight
down to Windows API calls). Anyway my code is something like the
following:
CMyDialog dlg;
dlg.Create(hwndParent);
dlg.ShowWindow(SW_SHOW);
Sleep(2000):
dlg.ShowWindow(SW_HIDE);
dlg.DestroyWindow();
Now, the dialog shows up fine and I can see the title bar. However,
the static text field is not visible. If, on the other hand, I execute
the code:
CMyDialog dlg;
dlg.DoModal(hwndParent);
then I can see the static text field and the dialog displays perfectly.
My code is simple enough that I have a feeling this is just one of
those common mistakes that everyon mistakes at least once, but I can't
figure out what it is. Does anybody have an idea what could be going
wrong? Thank you.