GetFileVersion
- Updated2024-10-09
- 2 minute(s) read
GetFileVersion
void GetFileVersion(long index, const char *path, IDispatch *inputStream, char *fileVersion, long maxVersionLengthInBytes, TSERROR *errorCode, char *errorMsg, long maxErrorMsgLengthInBytes)
Purpose
Returns the file version string for the file the path and inputStream parameters specify. National Instruments recommends using a file version format of "major.minor.revision.build" . Implement the callback to assign the file version to the fileVersion parameter. When the translator does not support reading file version information from the file, assign an empty string to the fileVersion parameter. When a translator supports obtaining the file version from a file, the TranslateToSequenceFile callback in the translator must assign the file version to the PropertyObjectFile.Version property of the translated sequence file. Otherwise, the version property is "0.0.0.0" . TestStand calls this callback to return a version string for the FileInformation.GetFileVersion method in the TestStand API.
Parameters
Name | Type | Description |
index | long | The zero-based index of the translator in the DLL that must process the callback. |
path | long | The path to the file. |
inputStream | InputStream | A reference to an InputStream object that contains the contents of the file TestStand attempts to open. |
fileVersion | string | The file version of the file. The callback must copy a string value to the existing buffer, including the NUL terminating character. Use the maxVersionLengthInBytes parameter to determine the size of the buffer. When the translator does not support reading file version information from the file, assign an empty string to the buffer. |
maxVersionLengthInBytes | long | The maximum number of bytes you can copy to the fileVersion parameter. |
errorCode | TSERROR | The error code when an error occurs in the callback. |
errorMsg | string | The error message when an error occurs in the callback. The callback must copy a string value to the existing buffer, including the NUL terminating character. Use the maxErrorMsgLengthInBytes parameter to determine the size of the buffer. |
maxErrorMsgLengthInBytes | long | The maximum number of bytes the DLL can copy to the errorMsg parameter. |