Best Way to Get Installed DLL Version
-
Hi everyone. In a program I am writing, I need to check which version of some system dlls are installed, for example. mfc42.dll, comctrl.dll, and a few others. I know there is a few ways of doing this, but what would be the "best" way to do this so that it will be compatible with future versions of Windows, and requires the least amount of overhead? Thanks in advance for any help!
-
Hi everyone. In a program I am writing, I need to check which version of some system dlls are installed, for example. mfc42.dll, comctrl.dll, and a few others. I know there is a few ways of doing this, but what would be the "best" way to do this so that it will be compatible with future versions of Windows, and requires the least amount of overhead? Thanks in advance for any help!
See April 98 C++ Q&A in MSDN Q How can I tell which version of a particular module (DLL) is installed on my system? I am trying to figure out which version of comctl32.dll is installed. I have seen code that calls GetProcAddress to try getting various functions like InitCommonControlsEx to determine the version based on which functions are present. This seems kludgy to me. What is the right way to get the version? A Well, there are two ways: the easy way and the hard way. The easy way is to call a special new entry DllGetVersion. The only problem is, while comctl32.dll supports this function, not all DLLs have it. If there's no DllGetVersion, you have to use the hard way—namely, the FileVersion API, which is perhaps one of the most confusing APIs you will ever come across.............. (see MSDN)