[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Get Pointer (reference) to a structure

tomi

10/21/2007 4:06:00 PM

Help please

Ho can I write following (from C#) thing in VB.NET ?

new IntPtr(&mode)


mode is a instance of some structure.
I cannot find any solution. I need to pass the pointer to a structure
to COM+ object Thanks

Tomas

1 Answer

(Mattias Sjögren)

10/21/2007 9:23:00 PM

0

>Ho can I write following (from C#) thing in VB.NET ?
>
>new IntPtr(&mode)

You can't get the exact equivalent in VB since it doesn't support
pointers. What you can do is allocate a buffer on the native heap and
copy the structure there. Use the Marshal.StructureToPtr method for
that.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.n... | http://www.dotneti...
Please reply only to the newsgroup.