简体   繁体   English

将C ++ API自动转换为C#?

[英]Automatic conversion of C++ API to C#?

I am wondering if there is something like automatic conversion/wrapper code generation of a c++ API to C#? 我想知道是否有类似C#的自动转换/包装代码生成c ++ API?

Specifically I am seeking a way to call the Remote Desktop Services API from C#. 具体来说,我正在寻找一种从C#调用远程桌面服务API的方法。

A suggestion: C++/CLI. 建议:C ++ / CLI。 Using the C++/CLI you can use the libraries written in C/C++ to C/C++ along with of the .net libraries/dll's. 使用C ++ / CLI,您可以使用C / C ++编写的库与C / C ++以及.net库/ dll一起使用。 More information: A first look at C++/CLI 更多信息: 首先看一下C ++ / CLI

No you definitely need to create an interop code. 不,你肯定需要创建一个互操作代码。 If it's a COM api there is some sort of support for using it directly with C# 如果它是COM api,那么可以直接在C#中使用它。

You might try either decompiling RDCMan (http://www.microsoft.com/download/en/details.aspx?id=21101), it does it. 您可以尝试反编译RDCMan(http://www.microsoft.com/download/en/details.aspx?id=21101),它会这样做。 Or there is an open source project on Codeplex that does it as well. 或者Codeplex上有一个开源项目也可以。

http://terminals.codeplex.com/ http://terminals.codeplex.com/

EDIT: 编辑:

There is also a tool that Microsoft provides call aximp (http://msdn.microsoft.com/en-us/library/8ccdh774(v=VS.100).aspx). Microsoft还提供了一个名为aximp的工具(http://msdn.microsoft.com/en-us/library/8ccdh774(v=VS.100).aspx)。 If you run aximp.exe {{path_to}}\\mstscax.dll, it will generate a .NET WinForms control library that wraps the ActiveX control. 如果您运行aximp.exe {{path_to}} \\ mstscax.dll,它将生成一个包装ActiveX控件的.NET WinForms控件库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM