- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a way to find out, at run time, the path of a DLL containing a function? My code calls routines contained in a DLL that another user may modify and build. If there are multiple versions of the DLL, the one that is actually used depends on where the user puts their DLL. I would like to have the ability to include the full path of the DLL in the output for diagnostic purposes. (And I would like it to work with shared libraries on *NIX.)
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Call the Win32 API GetModuleHandle to get a handle for the DLL and then GetModuleFileName on the handle to get the path. This does not extend to *NIX - I have no suggestions for you there.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page