Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Starting .Net application from C++ app

Status
Not open for further replies.

wallaceoc80

Programmer
Jul 7, 2004
182
0
0
GB
Hi, I have a question about starting a C# .Net application from another app that is written primarily in C++.

I basically want to add a menu option to the parent (C++) app so that when the user selects this menu option it fires and event that will open the .Net application.

Some other things I want to control are things like - I only want one instance of the child (.Net) application running at a time.

Any suggestions or help would be appreciated.

Regards,

Wallace
 
One thing I forgot to add is that when I launch the new application which is basically a form I want to be able to pass some data to it so that it is populated when it opens.



Thanks,

Wallace
 
If you're calling a .NET application, all you should need to do is use system(), or one of the spawn() functions. Of course if the system doesn't have the .NET runtime installed, you'll have a problem; but that's why your install program should check for the .NET runtime and install it if it's not present.
 
Thanks for the reply. What about the aspect of passing information from one to the other? Would this be easier if i was to create the .Net app as a dll and include it in the main C++ application?
 
You can pass command line parameters like this:
Code:
system( "dir /s /w" );
// or
spawnl( _P_NOWAIT, "dir", "/s", "/w", NULL );
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top