|
-
August 13th, 1999, 10:50 AM
#1
Status Dialog Question?
Hello All,
I currently trying to write a VC program to display a little box in the middle of the screen and display different status messages.
This is what I need.
1) Create, Display A window
2) After the window is visible, call a function.
3) That function needs to update the status field
4) Then another function is call
5) That function needs to update the status field
6) etc....
7) Then the program needs to exit without user intervention.
Any suggestions?
Thanks in advance,
Brad Cooper
[email protected]
-
August 13th, 1999, 01:46 PM
#2
Re: Status Dialog Question?
Brad,
Try creating a dialog resource with a text control. Write a member function of your dialog class to set the text of that control, say SetStatus(). Then:
void MyFunction()
{
CMyDialog dlg;
dlg.DoModal();
dlg.SetStatus("Entering foo1");
foo1();
dlg.SetStatus("Entering foo2");
foo2();
.
.
.
}
If you want to call SetStatus from within foo1 and foo2, you can pass a pointer to your dialog into those functions.
I hope that helps.
Lane
-
August 13th, 1999, 02:00 PM
#3
Re: Status Dialog Question?
You need to create a Modeless Dialog box. Use the Create function to create it. Call whatever functions you want. Then when you are through with it call dlg.OnClose() to destroy it. Make sure you override PostNcDestroy and call "delete this" to freee the memory.
If you need any more details let me know.
-
August 13th, 1999, 04:14 PM
#4
Re: Status Dialog Question?
Sorry, but I omitted three components to my reply:
1. Hide any and all buttons in your dialog. Don't delete the OK button, just make it not visible.
2. Override CDialog::OnOK() and make it public. Have it call the base class function.
3. At the end of your function in which you create the dialog and call its DoModal function, call its OnOK function.
-
August 13th, 1999, 04:24 PM
#5
Re: Status Dialog Question?
I must be brain dead. Please ignore my posts and use a modeless dialog as Wayne Fuller suggested.
Sorry for any confusion I may have caused you.
Lane
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|