Re: Dialog wait...Help me
Please, post your code causing the problems. Please, don't forget to use Code tags around code snippets.
Re: Dialog wait...Help me
Code:
CWaitDlg *wDlg = new CWaitDlg(); //CWaitDlg : Class of Dialog IDD_WAITDLG
wDlg->m_Text = _T("Please Wait..."); // m_text is type edit text of Dialog IDD_WAITDLG
wDlg->Create(IDD_WAITDLG,this);
wDlg->CenterWindow();
wDlg->ShowWindow(SW_NORMAL);
wDlg->UpdateWindow();
Sleep(2000); // ****//
wDlg->DestroyWindow();
When i insert " Sleep(2000) // ****// ", i can not move this dialog wait, after 2s ,i can move this window. And when i connect to hostting,it's empty as "not responding",
i think reason is my program,not win system .
Re: Dialog wait...Help me
It sure is your program that cause the issue. When you enter Sleep from the GUI thread you effectively prevent the message loop from executing.
Re: Dialog wait...Help me
Sleep() only example that i insert to test, my code connect to server is in Sleep().
When connect to server ,need a few time to finished (have not Sleep() )->but window dialog can't move and show not normal . It' s the same as Sleep.
Have you any way to create other Dialog Wait ?
Re: Dialog wait...Help me
Well, your thread is busy executing what you have in that "Sleep" block, so it has no time for displaying the dialog.
You could however, move this block into another thread...
Re: Dialog wait...Help me
thanks, i am trying make it by thread , :D
Re: Dialog wait...Help me
Have you considered using SetTimer / OnTimer?
Re: Dialog wait...Help me
The way I normally do this is to create a modeless dialog box with the "Please Wait" message, and display it before doing the task. Then when the task is finished, terminate the modeless dialog.