hey mattias.
doesn't the .NET move objects around?
don't i need to prevent this motion?
tnx
> All you have to do is make sure the delegate is alive (i.e. hold a
> reference to it to prevent garbage collection) as long as you use the
> pointer.
>
> Mattias
>doesn't the .NET move objects around?
Yes it does (sometimes).
>don't i need to prevent this motion?
No, the pointer the unmanaged code gets points to a stub that isn't
moved by the GC, and that will be valid as long as the delegate is.
The stub code knows how to locate the delegate, even if it has been
moved.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.