您是否知道一种软件可以从 native DLL 自动生成 C# 代码(在 .cs 中具有 [DllImport] 属性)以便在 C# 代码中使用此 DLL?
最佳答案
检查 P/Invoke Interop Assistant :
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.
关于c# - 从 native dll 生成 C# DLLImport 声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3771648/