Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / December 2004

Tip: Looking for answers? Try searching our database.

Get the DllImport library name for method

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jim.wiese@gmail.com - 19 Dec 2004 02:02 GMT
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.
Thanks in advance,

Jim
Mattias Sj?gren - 19 Dec 2004 11:54 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.