(SST) ShlWAPIFunctionInfo Version 1.0

Developer Reference
TSSTDllVerInfo.RetResourceSpecialBuild Method
Virtual function that retrieves the string returned when reading property ResourceSpecialBuild.
Protected (i.e. the method can only be accessed from code in a descendant class or the unit it which it is implemented).
Function RetResourceSpecialBuild() : STRING; VIRTUAL;  
Return Values
Returns the string extracted from the version information resources in the file specified in property DllFileName, provided the file contains a "VERSIONINFO" resource block/section and a value-string was assigned to the predefined "SpecialBuild" string-name in the resource definition file.
The function returns an empty string if the file was linked without version information resources, bit 5 (0-based) in the dwFileFlags member/field of the VS_FIXEDFILEINFO record is not set, the "SpecialBuild" member/field was left empty by the publisher of the file, or an error occurred during execution.
If the function returns an empty string due to an error, the class' LastError property may contain pertinent information on the nature of the fault in form of a Windows error code.
The function checks if bit 5 (0-based) is set in the dwFileFlags member/field of property ResourceFixedFileInfo. If it is, it continues by forming the sub-block, path string required to extract the actual resource, value-string from hard-coded strings and property ResourceLanguageIdAsStr. It then calls function WinApiVerQueryValueStr with the resulting, concatenated string as the parameter.
Even though the previously described implementation produces results compliant with the Microsoft programming guide­lines, in that it does not return the value-string unless bit 5 in the dwFileFlags member of the VS_FIXEDFILEINFO record is set, a behaviour in which it is, may be considered preferable.
The following code fragments outline three, alternative implementations that return the value-string assigned to the SpecialBuild string-name, if present, even if the VS_FF_SPECIALBUILD (= 0x20) flag is not set in the dwFileFlags member of the VS_FIXEDFILEINFO record.
1. Quick and Dirty.
2. Override Method RetResourceSpecialBuild.
3. Introduce New Property and Override Method in a Derived Class.
All of the implementations described above return the version information of the first (i.e. the primary) language id.
Unit (Declared and implemented in) SSTNewUnit.pas
Library SSTNewUnit.dcu/SSTNewUnit.obj
Unicode Implemented as ANSI version only.
See Also
TSSTDllVerInfo, ResourceSpecialBuild, WinApiVerQueryValueStr, ResourceFixedFileInfo, flasterror, LastError, Source Code
Windows APIs: VERSIONINFO Resource, VS_VERSIONINFO Structure, VS_FIXEDFILEINFO Structure, StringFileInfo Block/Structure.

Document/Contents version 1.00
Page/URI last updated on April 30, 2022
Copyright © Stoelzel Software Technologie (SST) 2010 - 2017
Suggestions and comments mail to: