Ole,
>My question is: what should be kept by the wrappers? .NET reflection
>objects or method indexes?
What are these method indexes? Is it the index into the array returned
by Type.GetMethods for a certain method name?
Since you're targeting v2.0 you could consider storing method tokens
instead (see MemberInfo.MetadataToken and Module.ResolveMethod()).
>If I keep the reflection objects, there will be a substantial amount
>of managed references in unmanaged C++ objects - how will this
>affect memory management and GC performance?
Well it will prevent the MethodInfo objects to be garbage collected
which may be a bad thing.
If you haven't already I recommend reading
http://msdn.microsoft.com/msdnmag/issues/05/07/Reflection/default.aspx
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Ole Nielsby - 17 Nov 2005 22:24 GMT
> Ole,
>
>>My question is: what should be kept by the wrappers? .NET reflection
>>objects or method indexes?
> Since you're targeting v2.0 you could consider storing method tokens
> instead (see MemberInfo.MetadataToken and Module.ResolveMethod()).
Seems a good idea, thanks. I hadn't noticed these.