从本机dll生成C#DLLImport声明 [英] Generate C# DLLImport declarations from a native dll

查看:482
本文介绍了从本机dll生成C#DLLImport声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您是否知道一个软件,它会自动生成C#代码(使用.cs中的[DllImport]属性)从本机DLL中,以便在C#代码中使用此DLL?

Do you know a soft which automatically generates C# code (with [DllImport] attributes in .cs) from a native DLL in order to use this DLL in a C# code?

推荐答案

查看 P / Invoke Interop Assistant


在编组中,有一堆
属性和规则。了解
所有这些属性和规则似乎是一个
有点令人生畏。为了使
开发工作更有效率,并且
更容易对这些属性和
规则,P / Invoke Interop Assistant
出来。它是一个帮助
开发人员有效地从
C转换为托管P / Invoke签名或
签证的工具包。这是概念上的
类似于TlbImp的COM Interop
,它生成托管代理条目
点,基于非托管方的一些正式
描述,但
它适用于P /调用。该工具包是
,首次在2008年1月的2008年1月的MSDN杂志
网站上发布。

In marshalling, there are a bunch of attributes and rules. Understanding all those attributes and rules seem a bit daunting. In order to make developing work more efficient and easier on those attributes and the rules, P/Invoke Interop Assistant comes out. It is a toolkit that helps developers to efficiently convert from C to managed P/Invoke signatures or verse visa. This is conceptually similar to TlbImp for COM Interop which generates managed proxy entry points based on some formal description of the unmanaged side but it works for P/Invoke. The toolkit was first released on MSDN Magazine website in Jan, 2008.website in Jan, 2008.

这篇关于从本机dll生成C#DLLImport声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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