如何绑定以2种不同语言开发的一个类功能 [英] How to bind one class functionality which is develop in 2 different language

查看:77
本文介绍了如何绑定以2种不同语言开发的一个类功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,其中我使用类在C#i中开发的一些方法具有相同的类和一些附加功能,但现在用c ++开发如何将两者结合起来并允许应用程序使用存在于两个班级请建议一些东西



我尝试过:



我正在尝试使用包装器类,但我不知道包装器类究竟在做什么

i have one application in which im using class with some methods developed in C# i have same class with some additional functionality but it is develop in c++ now how can i combine the two and allow application to use the functionality which is present in both the class please suggest something

What I have tried:

I was trying with wrapper class but i dont know what wrapper class do exactly

推荐答案

我将从这篇文章开始P/Invoke Tutorial:Basics(Part 1) [ ^ ]



基本上,

a)将你的c ++代码写成dll

b)导出函数定义
I'd start with this article P/Invoke Tutorial: Basics (Part 1)[^]

Basically,
a) write your c++ code as a dll
b) export the function definitions
__declspec(dllexport)



c)写c#P / Invoke Interop



实际上,我通常将'c'移动到'd'并且c)为dll编写和测试c ++线束..所以



a)写你的c ++代码作为dll

b)导出函数定义__declspec(dllexport)

c)编写并测试d ++的c ++线束

d)写c#P / Invoke Interop


c) write c# P/Invoke Interop

actually, I usually move 'c' down to 'd' and c) write and test a c++ harness for the dll .. so

a) write your c++ code as a dll
b) export the function definitions __declspec(dllexport)
c) write and test a c++ harness for the dll
d) write c# P/Invoke Interop


这篇关于如何绑定以2种不同语言开发的一个类功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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