我可以自动将C函数包装到C#/ .NET中吗? [英] can I automatically wrap C functions into C# / .NET?

查看:84
本文介绍了我可以自动将C函数包装到C#/ .NET中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上我希望能够创建一个指向任何静态库的程序(作为文件参数提供)并生成一系列可以在C#中使用的函数和结构。

是这可能吗?

Basically I would like to be able to create a program that points at any static library (fed as a file parameter) and generates a series of functions and structures that can be used in C#
Is this possible?

推荐答案

就像已经说过的那样,这个工具已经存在于基于COM的库中。



为标准库编写这样的工具是不可能的。原因是参数和返回值信息不存储在库中。只能找到导出的函数名称。
Like has been said already, that tool already exists for COM-based libraries.

It's impossible to write such a tool for standard libraries. The reason is that parameter and return value information is not stored in the library. Only the function names being exported can be found.


为什么在它已经存在的情况下创建一个免费的?



tlbimp.exe [ ^ ]
Why create one when it already exists, for free?

tlbimp.exe[^]


这篇关于我可以自动将C函数包装到C#/ .NET中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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