Hello Rulin,
If you have an variable and you want its address:
~
Dim GCH as GCHandle = GCHandle.Alloc(YourVar, GCHandleType.Pinned)
REM now GCH.AddrOfPinnedObject is pointer to your var so do whatever you
want
GCH.Free()
~
On the other hand, if you have an address, you can get a value:
~
DesiredValue = CType(Marshal.PtrToStructure(YourPointer,
DesiredValue.GetType), TypeOfDesiredValue)
~
Note that this time you actually get COPY of the value.
Marshal and GCHandle are located in System.Runtime.InteropServices
namespace.
Hope this helps
Dragon
"Rulin Hong" <Ru*******@discussions.microsoft.com> сообщил/сообщила в
новостях следующее:
news:46**********************************@microsof t.com...
What do we do for pointer in VB.NET?
Thanks