Solved

Obtaining DLL version information

Posted on 1997-05-28
2
323 Views
Last Modified: 2013-12-03
Under WIN32 I would like to have an "About" box that will show the version numbers of all the DLLs that the currently-executing program is using. It appears that the "GetFileVersionInfo" API will return this information IF I KNOW THE FULL PATHNAME OF EACH DLL THAT THE PROGRAM IS USING. Unfortunately, I don't know how to GET those pathnames from the executing program. Alternatively,  could I use 'EnumResourceNames' (or one of the other 'Enum' functions) to get the version information from all of the DLLs that are being using by the currently executing program?

The questions:

1. Is there any way to obtain (from within an executing program) what DLLs are being used by that program? If so, is there any way to get the full pathnames associated with each such DLL?

2. Can one of the 'Enum' functions be used to search the currently-executing EXE file ALONG WITH ALL THE DLLs THAT IT IS USING to obtain the version information associated with the EXE file and with each of the DLLs?

If either of these approaches can be used, an outline of the required 'C' code would be most useful! (I can't find any reasonable example of using the 'Enum' functions.)

Many thanks,

Wayne
0
Comment
Question by:wfb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
NickRepin earned 200 total points
ID: 1397695
I assume you know DLL names your program using.

1. Retrieve module handle for each DLL using GetModuleHandle. Note: you have not to specify a path, just name, eg : 'user32','kernel32', ets.

2. Retrieve full path name for each module:

char    modFName[MAX_PATH];
GetModuleFileName(hModule, modFName, sizeof(modFName));

3. Retrieve version info (you know how).

0
 

Author Comment

by:wfb
ID: 1397696
Nick,

My only complaint with your approach is that I would really prefer a more "generic" approach that would not require me to specify the names of all the DLLs that the program is using. For system DLLs, I suppose I could just keep calling 'GetModuleHandle' with all the normal names (KERNEL32, etc.) However, this would require me to keep updating a list as MS comes out with DLLs having different names (MSVCRTnn.DLL, for example).

If you can think of any  way that the names of all "in use" DLLs for a program can be obtained, I would certainly like to hear about it!

Many thanks,

Wayne
 
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question