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 / .NET Framework / New Users / August 2004

Tip: Looking for answers? Try searching our database.

Marshalling in C#.......Please Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MVB - 26 Aug 2004 21:13 GMT
Below is a certain function in c++.....
OTMSTATUS OTMAPI Otm_CreateSnapShotW(
IN    pOpenTransactionInW  In,
IN    ULONG NumVolumes,
IN    PVOID InVolumeMap,
IN    ULONG *VolumeMapFlags,
IN    ULONG OutVolumeMapByteSize,
INOUT PVOID OutVolumeMap,
OUT   pOpenTransactionOutW Out,
OUT   pSnapShot *SnapShot
INOUT LPOVERLAPPED Overlapped,
IN    LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine
                               );

How would i PInvoke it so taht I can use it in C#?
INOUT PVOID OutVolumeMap is the output given by the function and it is in
the form of a string array.How would I define OutVolumeMap so that it would
give me the right result??

Thanks and Regards
MVB
Sijin Joseph - 27 Aug 2004 10:02 GMT
You will need to use the MarshalAsAttribute

[MarshalAs(UnmanagedType.LPArray,Out)] string[] OutVolumeMap

Reference:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmex/html/vcgr
fmarshalingarrays.asp

http://support.microsoft.com/default.aspx?scid=kb;EN-US;305990

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

> Below is a certain function in c++.....
> OTMSTATUS OTMAPI Otm_CreateSnapShotW(
[quoted text clipped - 17 lines]
> Thanks and Regards
> MVB

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.