I’m a programming student, and I’ve now had two classes in C#, this semester I’m taking my first C++ class.
Out of curiosity, is it possible to call a C# application from a C++ application?
If so, is it also possible to check if the computer running the program has the .NET framework?
I’m just curious, and I think if its possible, it would be a great little program to write and have as a tool for the future.
Just for your information, here’s what I’d like to do:
- Check to see if .NET framework is installed on the computer
- If it’s not, ask the user if they would like to install it, and if they would, proceed to download and install the framework
- Call my program written in C# and then kill the C++ program
Yes. There are a few options here. If you use C++/CLI, you can use types defined in C# directly from within C++. Otherwise, a typical approach is to use COM, esposing your C# types as COM objects.
Yes. Here, typically, you’d just install the framework along with your application. Here’s a page that shows a few options for checking which version of .NET (if any) is installed.