从c ++ dll中提取函数信息 [英] Extract function information from c++ dll
问题描述
谢谢
我假设你只有DLL本身,如果你有一个头文件,这将会更容易,因为你可以直接跳过来找出如何PInvoke它。
首先你必须掌握函数签名,所以你知道参数和它们的类型。如果它是一个C ++ DLL,您可能可以通过 Dependency Walker 获取此信息,如果它是C DLL,您可能需要查看实际的汇编代码来计算参数及其类型。
如果您确定了签名,则可以使用PInvoke调用它来自C#,查看PInvoke 网站了解更多详细信息和许多示例。
i have c++ DLL and 1 program (not code) , that program calls 1 function from DLL, i know only name of that function, now all want to call that function from my application(C#). Is it possible?
Thanks
I'm assuming that you only have the DLL by itself, if you've got a header file as well it would be much easier since you can skip straight to figuring out how to PInvoke it.
First you have to get hold of the function signature so you know the arguments and their types. If it's a C++ DLL you might be able to get this out with Dependency Walker, if it's a C DLL, you might have to look at the actual assembly code to figure out the arguments and their types.
If you do figure out the signature, then you can use PInvoke to call it from C#, look at the PInvoke website for more details and many samples.
这篇关于从c ++ dll中提取函数信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!