Why Static text doesn't show up
-
hi I have to do a file conversion which is a very lengthy task. To show user that the program is converting, I create a modalless dialog with a static text "CONVERTING..." on it. I intend to show it before calling the convert function and hide the dialog after conversion done. code like this: CDlgInfo *dlg = new CDlgInfo; dlg->Create(IDD_INFO,this); dlg->ShowWindow(SW_SHOW); CallConvertFunction(........sth...) dlg->ShowWindow(SW_HIDE); it doesn't work. my dialog show up without the static text on it. If I replace the convert function call with MessageBox("laksdjlf") then my IDD_INFO dialog shows up with its static text with no proplem. I dont understand why this happen. I have try insert Sleep(1000) or even system("pause") before the convert function call but it also doesn't work.
-
hi I have to do a file conversion which is a very lengthy task. To show user that the program is converting, I create a modalless dialog with a static text "CONVERTING..." on it. I intend to show it before calling the convert function and hide the dialog after conversion done. code like this: CDlgInfo *dlg = new CDlgInfo; dlg->Create(IDD_INFO,this); dlg->ShowWindow(SW_SHOW); CallConvertFunction(........sth...) dlg->ShowWindow(SW_HIDE); it doesn't work. my dialog show up without the static text on it. If I replace the convert function call with MessageBox("laksdjlf") then my IDD_INFO dialog shows up with its static text with no proplem. I dont understand why this happen. I have try insert Sleep(1000) or even system("pause") before the convert function call but it also doesn't work.
Probably WM_PAINT messages are not being processed because no window messages are being dispatched during CallConvertFunction(). What if you force a paint, something like this: CDlgInfo *dlg = new CDlgInfo; dlg->Create(IDD_INFO,this); dlg->ShowWindow(SW_SHOW); dlg->Invalidate(FALSE); dlg->UpdateWindow(); CallConvertFunction(........sth...) dlg->ShowWindow(SW_HIDE);
-
Probably WM_PAINT messages are not being processed because no window messages are being dispatched during CallConvertFunction(). What if you force a paint, something like this: CDlgInfo *dlg = new CDlgInfo; dlg->Create(IDD_INFO,this); dlg->ShowWindow(SW_SHOW); dlg->Invalidate(FALSE); dlg->UpdateWindow(); CallConvertFunction(........sth...) dlg->ShowWindow(SW_HIDE);
Thanks a lot. it now runs as I wish my convert function uses all low level programming techniqe (i wrote it using just C, not C++) and is separated from all windows message. so it was really because of WM_PAINT messages not processed. -- modified at 23:16 Thursday 14th December, 2006