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
Mattias Sjögren - 16 Mar 2006 21:21 GMT
>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

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.