-------------------------------------------------- The addresses of data items can be retrieved, but retrieval must be done via calls into the CLR. This is because the CLR is normally free to move items within memory, so it needs to know when not to move the item while the address is being used. The following example retrieves the address of an object: Dim MyGCHandle As GCHandle = _ GCHandle.Alloc _ (o, GCHandleType.Pinned) Dim Address As Integer = _ CInt( _ MyGCHandle.AddrOfPinnedObject()) '... MyGCHandle.Free() 'allows the _ object instance to be moved again
Allowing data items to be moved by the runtime improves the performance of the runtime.
はじめまして。VB6ではinputbox関数でキャンセルキーが押されたかどうかを
strptr関数を使って判断していましたが、.NETではstrptr関数が無くなって
しまいました。つまりオブジェクトのアドレス値を得たいのです。
よろしくお願いします。