Reputation: 247
Is it must that all the dlls created in C++ have a version number ? I have dlls in my machine but when i right click i am not able to see the version number.
P.S : I have Win 7 installed.
Upvotes: 7
Views: 22036
Reputation: 221997
It's important to understand, that the version number will be not used during loading the DLL. So it's not required information which DLL or and Program Executable (Like .EXE, .OCX, .SYS, .FON and so on) must have.
The real purpose of version is to help installation program to compare the DLL existing on the computer with the installed one. The most important version in the case is FILEVERSION
part or the VERSIONINFO resource. You can read more about the API to access the information on MSDN.
The version resource is very practical also for support. If you good protocol the changes in the DLL which you redistribute to other computers or other clients then the version resource could help you for troubleshooting. By examining of the version of the DLL you can probably find out whether the problem which take place is already well-known and are fixed in the more recent version of the DLL.
Upvotes: 9
Reputation: 3385
It's not mandatory to have version information in a DLL. However, if you intend to release more than 1 version, it is recommended to add some versioning information for support/maintenance purposes.
Here's how you add version information to win32 binaries.
Also you can embed version information in an existing exe/dll.
EDIT: added some more information for purpose (from Oleg's link):
You can use the version information functions to determine where a file should be installed and identify conflicts with currently installed files. These functions enable you to avoid the following problems:
- installing older versions of components over newer versions
- changing the language in a mixed-language system without notification
- installing multiple copies of a library in different directories
- copying files to network directories shared by multiple users
The version information functions enable applications to query a version resource for file information and present the information in a clear format. This information includes the file's purpose, author, version number, and so on. You can add version information to any files that can have Windows resources, such as DLLs, executable files, or .fon font files. To add the information, create a VERSIONINFO Resource and use the resource compiler to compile the resource.
Upvotes: 6