468,103 Members | 1,311 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,103 developers. It's quick & easy.

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

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

Mar 16 '06 #1
1 1331
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

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

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by July | last post: by
1 post views Thread by liguoqiang_0121 | last post: by
16 posts views Thread by recover | last post: by
15 posts views Thread by arnuld | last post: by
8 posts views Thread by not_a_commie | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.