如何在C ++项目中使用C#项目中定义的命名空间和API,其中两个项目都在同一个解决方案中。 [英] How to use the namespace and API's defined in a C# project in C++ project, Where both the projects are under same solution.

查看:123
本文介绍了如何在C ++项目中使用C#项目中定义的命名空间和API,其中两个项目都在同一个解决方案中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含2个C ++项目[控制台类型]的解决方案,现在正在使用GUI创建一个C#项目到同一个解决方案,需要管理C ++项目的用例,为此,我想要使用C#项目中定义的API来
更新C ++项目中的变量。


我怎样才能实现这个目标?


解决方案

您好,


如果您的C ++项目是用非托管C ++编写的,那么唯一的方法是使用托管代码非托管项目正在使用CLR 托管API或COM,但这非常困难 


I have a solution which has 2 C++ projects[console type] and now am creating a C# project to the same solution with GUI which needs to manage the use-case's of C++ project, For this purpose I want to use the API's defined in C# project to update the variables in C++ project.

How can I achieve this ?

解决方案

Hello,

If your C++ projects written in unmanaged C++ then the only way use managed code in unmanaged project is using  CLR hosting API or COM, but it is pretty difficult 


这篇关于如何在C ++项目中使用C#项目中定义的命名空间和API,其中两个项目都在同一个解决方案中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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