views:

525

answers:

2

Hi, 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.

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.

Please me to solve this issue. Any help would be appreciated.

Thanks, YOgi

A: 

Since you don't provide much detail about your problem I can only help you by directing you to the documentation. You can read more about platform invoke and how to marshal structures and unions on MSDN

Martin Liversage
Thanks Martin for you reply. I read alot about marshalling on Net. and I made structures but the issue is that when I call that dll function it make one structure value to Null but others contain same values as I passed into them prior to fucntion call.
Yogi
Maybe that's a function return value?
Wilhelm
+1  A: 

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.

MarkJ