Programmatically launching a .NET assembly

  • Thread starter Thread starter dvestal
  • Start date Start date
D

dvestal

How can I launch a .NET executable (a windows app written in VB.NET)
from within another .NET assembly, and be able to tell when the user
receives control?

I could just kick it off with System.Diagnostics.Process.Start, but it
has a lengthy loading sequence, and I wouldn't know when it was loaded.
So, is it be possible to launch the app and trap the main form's
Activate event? Is there an easier way?
 
You would need to have some sort of indication on the program you are
running when it was started up. I would use a named event for this, which
fires when the app is done loading.

Hope this helps.
 
You could use the Reflection namespace, Use the Assembly and type attributes
to set up your external exe ie: Assembly.LoadFrom("path");
Type t = Assembly.GetType("Object.Type");
Then use Activator.CreateInstance
Hope this helps



--
threetoes


Nicholas Paldino said:
You would need to have some sort of indication on the program you are
running when it was started up. I would use a named event for this, which
fires when the app is done loading.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

How can I launch a .NET executable (a windows app written in VB.NET)
from within another .NET assembly, and be able to tell when the user
receives control?

I could just kick it off with System.Diagnostics.Process.Start, but it
has a lengthy loading sequence, and I wouldn't know when it was loaded.
So, is it be possible to launch the app and trap the main form's
Activate event? Is there an easier way?
 
That's not going to work for an executable, and it doesn't address the
issue of knowing when the program reaches a certain point.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

threetoes said:
You could use the Reflection namespace, Use the Assembly and type
attributes
to set up your external exe ie: Assembly.LoadFrom("path");
Type t = Assembly.GetType("Object.Type");
Then use Activator.CreateInstance
Hope this helps



--
threetoes


Nicholas Paldino said:
You would need to have some sort of indication on the program you are
running when it was started up. I would use a named event for this,
which
fires when the app is done loading.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

How can I launch a .NET executable (a windows app written in VB.NET)
from within another .NET assembly, and be able to tell when the user
receives control?

I could just kick it off with System.Diagnostics.Process.Start, but it
has a lengthy loading sequence, and I wouldn't know when it was loaded.
So, is it be possible to launch the app and trap the main form's
Activate event? Is there an easier way?
 
Hi,

Check docs for: Process.WaitForInputIdle()

This function blocks the caller until the target program has
initialized, displayed its main window, and is ready to process
messages...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top