Jim,
>I was wondering if anyone knows how to get the DllImport library name
>for a method? I'd like to use reflection on an existing assembly to
>get the library name for a method if it is a PInvokeImpl method.
Unless you're using a v2.0 preview version of the framework,
Reflection doesn't return that information. The unmanaged metadata
APIs do, however.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
jim.wiese@gmail.com - 19 Dec 2004 19:37 GMT
Mattias,
Thanks for the pointer. Do you have any sample code that would be
able to query this through the unmanaged COM API? Any samples for this
would be greatly appreciated.
I did find another way to do it using the AbsIL package from Microsoft
research, but as usual, it's almost completely convoluded (it's written
in F#, the language).
http://blogs.msdn.com/joelpob/archive/2004/09/22.aspx
http://research.microsoft.com/projects/ilx/absil.aspx
Mattias Sj?gren - 19 Dec 2004 22:59 GMT
>Do you have any sample code that would be
>able to query this through the unmanaged COM API? Any samples for this
>would be greatly appreciated.
All I have is some C++ code. And there's a sample called Metainfo
included in the SDK (in the Tool Developers Guide\samples directory)
that shows how this API is used.
Mattias

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