Imports rtis = System.Runtime.InteropServices
Function VarPtr(ByVal e As Object) As Integer
Dim GC As rtis.GCHandle
Dim GC2 As Integer
GC = rtis.GCHandle.Alloc(e, rtis.GCHandleType.Pinned)
GC2 = GC.AddrOfPinnedObject.ToInt32
GC.Free()
Return GC2
End Function
How to use VarPtr in VB.NET ?
于 2019-05-27 22:48:23 首次发布