how to do this mapping "const struct outputinfor ** b" using p/invoke

G

geri.gan

I have C API just like this:

enum void getinfor(const struct inputinfor *a, const struct outputinfor
** b)

i use p/invok to translate it to

[DllImport("fmd_access.dll", CallingConvention =
CallingConvention.StdCall)]
internal static extern void getinfor(ref inputinfor a,
ref
outputinfor b)
what's the different between *a and **b? do they need to mapping to
different C# data type?

Does any one know how to using p/invoke to map "onst struct ouputinfor
**ba".

Thanks
 
M

Mattias Sjögren

what's the different between *a and **b?

One level of indirection.

do they need to mapping to different C# data type?

Yes, try making the parameter an out IntPtr. Then use
Marshal.PtrToStructure to dereference it to a outputinfor struct.


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top