By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,882 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,882 IT Pros & Developers. It's quick & easy.

Showing an info message during external application execution

P: n/a
Hi group,

I must launch from my Winforms application another application (.exe
developed by the client) which response time sometimes can be more or
less 30 seconds.

I'm using ProcessManager class and WaitForExit() to start it and wait
till it rsponds me. It's necessary for the application to get a
response, that's why I use WaitForExit().
I don't have access to the external .exe developed by the client,
therefore I've built a little console application that imitates the
behaviour and wait 30 seconds with
System.Threading.Thread.Sleep(30000). Don't know if this is the correct
way to imitate the .exe application's behaviour.

If yes, the idea is to show the user in a texbox the curren state of
the application. Therefore, before starting the process, I show him
"Starting external .exe...", then I launch the external application and
wait for its exit.

Well, all messages I want to show to user before launching the external
..exe are not shown. I want a message to be in the textbox while the
console application is being executed! And it seems like when launching
the console application my main application gets somehow blocked and do
not show any messages.

Thanks very much in advance.

Jul 14 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

I did not notice about Application.DoEvents()

Thanks.

Jul 14 '06 #2

P: n/a
Hi,

"Lonifasiko" <ml*******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Hi,

I did not notice about Application.DoEvents()
You would be better if you had not notice it :)

DoEvents should not be used for this kind of processing. The correct way is
to create a thread launch the app from there and inform the main thread (the
ui thread) of any changes or the completion of the execution.
Do a search in the archives of Control.Invoke you will find plenty of posts
about this.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Jul 14 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.