Displaying Message Box while program(code) continues [modified]
-
Is it possible for me to display the message box and let the nxt function to process while the message box remains displayed and the user cannot close it. The message box will have to be closed after the function finishes. If yes, how can I go abt doing it? Another question is how can I display a dialog box ( using doModal() ) and perform a function immediately without User Interaction? Thanks!! -- modified at 3:33 Wednesday 31st May, 2006
-
Is it possible for me to display the message box and let the nxt function to process while the message box remains displayed and the user cannot close it. The message box will have to be closed after the function finishes. If yes, how can I go abt doing it? Another question is how can I display a dialog box ( using doModal() ) and perform a function immediately without User Interaction? Thanks!! -- modified at 3:33 Wednesday 31st May, 2006
KongHL wrote:
Is it possible for me to display the message box and let the nxt function to process while the message box remains displayed and the user cannot close it.
You'll have to use modeless dialogs for that. Take a look at this article[^].
KongHL wrote:
Another question is how can I display a dialog box ( using doModal() ) and perform a function immediately without User Interaction?
Override OnInitDialog and call the function there.
Cédric Moonen Software developer
Charting control -
Is it possible for me to display the message box and let the nxt function to process while the message box remains displayed and the user cannot close it. The message box will have to be closed after the function finishes. If yes, how can I go abt doing it? Another question is how can I display a dialog box ( using doModal() ) and perform a function immediately without User Interaction? Thanks!! -- modified at 3:33 Wednesday 31st May, 2006
This might help you: Delay MessageBox with auto-close option[^] Good luck and keep the good coding!
-
This might help you: Delay MessageBox with auto-close option[^] Good luck and keep the good coding!
-
KongHL wrote:
Is it possible for me to display the message box and let the nxt function to process while the message box remains displayed and the user cannot close it.
You'll have to use modeless dialogs for that. Take a look at this article[^].
KongHL wrote:
Another question is how can I display a dialog box ( using doModal() ) and perform a function immediately without User Interaction?
Override OnInitDialog and call the function there.
Cédric Moonen Software developer
Charting control -
Is it possible for me to display the message box and let the nxt function to process while the message box remains displayed and the user cannot close it. The message box will have to be closed after the function finishes. If yes, how can I go abt doing it? Another question is how can I display a dialog box ( using doModal() ) and perform a function immediately without User Interaction? Thanks!! -- modified at 3:33 Wednesday 31st May, 2006
KongHL wrote:
Is it possible for me to display the message box and let the nxt function to process while the message box remains displayed and the user cannot close it.
This goes against the concept of a message box. One way you could get this effect is to display the message box in another thread. It might be simpler to make your own modeless dialog however. Steve
-
Hmm I mean doModal(), then call a function of that dialog class immediately after the dialog is being displayed. Is it possible?
you can write your funtion in OnShowWindow ; But still it won't fulfill your purpose as you want to call the funtion after the dialog is displayed. In that case I have two options. First in the OnInitDialog function you call SetTimer to set time say 1 sec. Then call your funtion in OnTimer and kill the timer in OnTimer function. Second method is that you create a thread to call your funtion. and start the thread in OnShowWindow. Regards Anil
-
Is it possible for me to display the message box and let the nxt function to process while the message box remains displayed and the user cannot close it. The message box will have to be closed after the function finishes. If yes, how can I go abt doing it? Another question is how can I display a dialog box ( using doModal() ) and perform a function immediately without User Interaction? Thanks!! -- modified at 3:33 Wednesday 31st May, 2006
KongHL wrote:
Is it possible for me to display the message box and let the nxt function to process while the message box remains displayed and the user cannot close it.
Please have a look on Mauro Leggieri's Background Task Dialog[^] Good luck and keep the good coding!
-
Delay MessageBox delays a short period of time before going to the next step of code.. But I would like to display the messagebox and continue the nxt step of code as per normal.. Am I correct to say that?
KongHL wrote:
Delay MessageBox delays a short period of time before going to the next step of code.. But I would like to display the messagebox and continue the nxt step of code as per normal..
Create the ModelLess Dialog box!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
Is it possible for me to display the message box and let the nxt function to process while the message box remains displayed and the user cannot close it. The message box will have to be closed after the function finishes. If yes, how can I go abt doing it? Another question is how can I display a dialog box ( using doModal() ) and perform a function immediately without User Interaction? Thanks!! -- modified at 3:33 Wednesday 31st May, 2006
you could also call it from another thread...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
-
you could also call it from another thread...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
toxcct wrote:
you could also call it from another thread...
UI Thread or worker Thread:)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
toxcct wrote:
you could also call it from another thread...
UI Thread or worker Thread:)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
i'm not good at using thread (i nenver used them yet), so i cannot say exactly where is the difference b/w them.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
-
i'm not good at using thread (i nenver used them yet), so i cannot say exactly where is the difference b/w them.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
toxcct wrote:
i'm not good at using thread (i nenver used them yet), so i cannot say exactly where is the difference b/w them.
Kiddin, it work well from both Option!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
toxcct wrote:
i'm not good at using thread (i nenver used them yet), so i cannot say exactly where is the difference b/w them.
Kiddin, it work well from both Option!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
any hint btw about the diff between ui thread and worker thread ?
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
-
any hint btw about the diff between ui thread and worker thread ?
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
toxcct wrote:
any hint btw about the diff between ui thread and worker thread ?
http://www.flounder.com/mvp_tips.htm#Using%20User-Interface%20Threads[^] http://www.flounder.com/mvp_tips.htm#Using%20Worker%20Threads[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
you can write your funtion in OnShowWindow ; But still it won't fulfill your purpose as you want to call the funtion after the dialog is displayed. In that case I have two options. First in the OnInitDialog function you call SetTimer to set time say 1 sec. Then call your funtion in OnTimer and kill the timer in OnTimer function. Second method is that you create a thread to call your funtion. and start the thread in OnShowWindow. Regards Anil
_anil_ wrote:
First in the OnInitDialog function you call SetTimer to set time say 1 sec.
very bad idea...!! consider the case where you init your dialog with a database which it connection is long to establish (at least more that 1 sec)... the program will behave badly.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
-
_anil_ wrote:
First in the OnInitDialog function you call SetTimer to set time say 1 sec.
very bad idea...!! consider the case where you init your dialog with a database which it connection is long to establish (at least more that 1 sec)... the program will behave badly.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
Yes you are right:-), Its a bad idea, depending on the situation. But the programmer know what he wants, and aware of the conditions. if the condition is according to you then we can use thread instead. But I think still I can make it to work.
void OnShowWindow(){ // here I set timer SetTimer(....); // Then the database connection // Its long enough 1 sec // problem ..... return; }
second case
void OnShowWindow(){ // Then the database connection // Its long enough 1 sec // here I set timer SetTimer(....); // less chance of problem return; }
It depends on when you set the timer. But I still agree with you that its a bad idea. But is one of the solution depending on the situation. Regards Anil -- modified at 5:25 Friday 2nd June, 2006