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