![]() |
(SST) ShlWAPIFunctionInfo Version 1.0 |
---|---|
Developer Reference |
Deteermines the memory size necessary to store a copy of the version information data retrieved from the executable specified in property DllFileName in a buffer on the heap. |
Scope |
---|
Protected (i.e. the method can only be accessed from code in a descendant class or the unit it which it is implemented). |
Syntax | |
---|---|
Function RetResourceVersionInfoSize() : INTEGER; VIRTUAL; |
Parameters | |
---|---|
None |
Return Values |
---|
If the function succeeds it updates member variable fversioninfosize and returns the size of the version information resources in the file specified by DllFileName. If the function fails it returns zero or a negative value and member variable fversioninfosize will have been set to that value. |
Remarks |
---|
The returned value is also available in the form of property ResourceVersionInfoSize, and reading the property should be preferred to calling the RetResourceVersionInfoSize function directly. |
After having set member variable fversioninfosize to zero, the function calls the Delphi SDK function FileExists to verify the existence of the file specified by property DllFileName. If FileExists returns TRUE, the method calls the ANSI version of the Windows API function GetFileVersionInfoSize, specifying property DllFileName, type-casted to a PChar, as the first parameter, and the return value directly updating member variable fversioninfosize.
If the subsequent evaluation of fversioninfosize shows that it is smaller or equal to zero, method SetLastErrorCode is called
with a default error code -1 (0xFFFFFFFF).
In the event that the file could not be located or access to it was denied (FileExists returned FALSE), the method calls procedure SetLastErrorCode with a default error code of ERROR_FILE_NOT_FOUND (= 2), leaving member variable fversioninfosize unchanged (i.e. set to zero).
In both cases the method returns the value stored in member variable fversioninfosize.
|
To ascertain if the function failed when it returns values smaller or wqual to zero, read property LastError immediately after the call. |
Note, that due to the use of the Delphi SDK function FileExists, it is necessary that a fully qualified or relative path and file name are specified in property DllFileName, even though the Windows API function called by the method searches for the file name in various folders if only a name is provided. |
Requirements | |
---|---|
Unit | (Declared and implemented in) SSTNewUnit.pas |
Library | SSTNewUnit.dcu/SSTNewUnit.obj |
Unicode | Implemented as ANSI version only. |
See Also |
---|
TSSTDllVerInfo, DllFileName, fversioninfosize, ResourceVersionInfoSize, SetLastErrorCode, LastError, Source Code. |
Windows APIs: GetFileVersionInfoSize, VERSIONINFO Resource, GetLastError, |
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: webmaster@stoelzelsoftwaretech.com |