Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
geri.gan@gmail.com - 16 Mar 2006 17:42 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.