
Modal vs. Modeless dialog and controls not showing
This is indeed a progress dialog. It looked to me like I was getting
back into the message loop, but I tried your suggestion anyway but it
had no effect.
I did find a solution to this, although I am not sure why it works.
If anyone can explain I'd be interested just out of curiosity.
Actually, there where 2 solutions. I found some other code that
showed a progress dialog and these were the differences and in fact
they did make the difference.
(1) My original code launched the dialog like this from the main
window:
ProgressDlg* prog = new ProgressDlg(this);
prog->Create(IDD_PROGRESS);
prog->ShowWindow(SW_NORMAL);
The code I found had the ShowWindow() call in the OnInitDialog()
itself. When I did this, my static text fields showed up immediately
but still no progress controls.
(2) Also in OnInitDialog() of the code I found was:
// Have to do this twice to get progress bar to display
m_prog.SetPos(1);
m_prog.SetPos(0);
I added this to my OnInitDialog() and poof, my progress controls
showed up immediately as well.
Quote:
> This sounds like a progress dialog. Are you getting back to a message loop
> anytime soon? If not, the controls may not be getting their paint messages.
> If so, you could try forcing the update yourself. (e.g.
> RedrawWindow(GetSafeHandle(), NULL, NULL, RDW_UPDATENOW | RDW_ALLCHILDREN);
> maybe with RDW_INVALIDATE also)
> HTH
> Jay