启用调用C DLL在VB.net code [英] Enable to call C dll in VB.net Code
问题描述
我遇到了我现在用C DLL到我VB.net code的一个问题。我有.H文件,显示实现这个DLL的C语言。
这个.H文件中包含许多结构和包含一些结构类型的变量工会。有包含指向这些结构和联合,最后主要结构的地址被传递到DLL功能的主要结构
I am running into a problem which I am using C Dll into my VB.net code. I have .H file which shows implementation of this DLL in C language. This .H file contains many structures and unions that contain variable of some structures type. There is a main structure which contains the pointers to these structures and unions and finally address of main structure is passed into the dll function.
我能弄清楚如何创建结构和联合在vb.net编组,以及如何通过包含othere结构和联合的地址结构的地址。
I am enable to figure out how to create structures and unions with marshalling in vb.net and how to pass address of a structure which contains addresses of othere structures and unions.
请我来解决这个问题。任何帮助将是AP preciated。
Please me to solve this issue. Any help would be appreciated.
感谢,瑜珈
推荐答案
有一个免费的工具<一个href=\"http://download.microsoft.com/download/f/2/7/f279e71e-efb0-4155-873d-5554a0608523/CLRInsideOut2008%5F01.exe\"相对=nofollow> CLRInsideOut ,将你的C结构定义转化为VB.NET的PInvoke code。阅读更多 MSDN上这里。免责声明: JaredPar 确实应该得到任何代表点这个答案,因为他的写一些工具的。
There is a free tool CLRInsideOut that will convert your C structure definitions to VB.NET PInvoke code. Read more on MSDN here. Disclaimer: JaredPar should really get any rep points for this answer since he wrote some of the tool.
这篇关于启用调用C DLL在VB.net code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!