是否有可能使一个呼叫从一个C ++应用程序C#应用程序? [英] Is it possible to make a call to a C# application from a C++ application?

查看:133
本文介绍了是否有可能使一个呼叫从一个C ++应用程序C#应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个编程的学生,而我现在已经在C#两班,这个学期我要带我的第一个C ++类。

出于好奇,是有可能调用从C ++应用程序C#应用程序?

如果是这样,它也可以检查运行程序的计算机有.NET框架?

我只是好奇,我想如果可能的话,这将是一个伟大的小程序写入并作为未来的一个工具。

只是为了您的信息,这就是我想要做的:

  • 检查是否.NET框架安装在计算机上
  • 如果不是的话,询问用户是否愿意安装它,如果他们愿意,请下载并安装该框架
  • 在叫我的程序用C#编写,然后杀了C ++程序
解决方案
  

出于好奇,是有可能调用从C ++应用程序C#应用程序?

是的。这里有几个选项。如果使用C ++ / CLI中,可以使用在C#中定义的类型直接从C ++。否则,一个典型的方法是使用COM,esposing你的C#类作为COM对象。

  

如果是这样,它也可以检查运行程序的计算机有.NET框架?

是的。在这里,通常情况下,你只沿安装框架与应用程序。这里有一个页面,显示了几个选项对于检查其.NET版本(如果有的话)已安装

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

解决方案

Out of curiosity, is it possible to call a C# application from a C++ application?

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.

If so, is it also possible to check if the computer running the program has the .NET framework?

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.

这篇关于是否有可能使一个呼叫从一个C ++应用程序C#应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆