online source control
back to content
sign up free version control plan

ISAWHAppObject::GetOldVersionFile

Description

Retrieves an old version of a file from the server.

Syntax

Long GetOldVersionFile(
        BSTR FileName,
        Long VersionNumberLow,
        Long VersionNumberHigh,
        BSTR LocalFileName,
       
VARIANT_BOOL MakeWritable,
        Enum_ModifiedFileHandling ModifiedFileHandling,
        Enum_EOL EOL,
        Enum_CompareFileBy CompareFileBy,
        Enum_SetLocalFileTime SetLocalFileTime,
       
ISAWHDiffMergeParam* MergeParam,
       
VARIANT_BOOL* Cancelled,
        BSTR* ResultDescription,
);

Parameters

FileName
[in] Specifies the full name of the file to be retrieved.

VersionNumberLow
[in] Specifies the low-order 32 bits of the file version to be retrieved.

VersionNumberHigh
[in] Specifies the high-order 32 bits of the file version to be retrieved.

Note: VersionNumberLow and VersionNumberHigh form a single 64-bit version number.

LocalFileName
[in] Specifies the path name of the local file retrieved from the server.

MakeWritable
[in] Specifies whether to make the local file writable after being retrieved from the database.

ModifiedFileHandling
[in] Specifies how to handle the local file if a writable copy of the file exists in the local disk.

EOL
[in] Specifies which end-of-line terminator is to be used for files.

CompareFileBy
[in] Specifies how to determine if the local copy is up-to-date, by checksum or by date/time.

SetLocalFileTime
[in] Specifies the type of time to be assigned to the local file.

MergeParam
[in] Specifies the parameters used for merge.

Cancelled
[out] If the method fails, returns whether the operation is cancelled.

ResultDescription
[out] Returns the description of the return value. If the method succeeds, returns 'Completed'. If the method fails, returns the description of the error.

Return Value

If the method succeeds, returns 0. If the method fails, returns other error codes.

See Also

Sample

VB Sample:

Dim WithEvents sdkObject As SAWHSDKLib.SAWHAppObject

Set sdkObject = New SAWHSDKLib.SAWHAppObject

Private Sub GetOldVersionFile_Click()

	Dim VersionNumber As Double
	Dim Cancelled As Boolean
	Dim ResultDescription As String
	Dim FileNameOnServer As String
	Dim VersionNumberLow As Long
	Dim LocalFileName As String
	Dim MergeParam As New SAWHDiffMergeParam

	FileNameOnServer = "$/FileName.txt"
	VersionNumberLow = 1
	LocalFileName = "D:\LocalFile.txt"

	Dim ResultValue As Long
	ResultValue = sdkObject.GetOldVersionFile(FileNameOnServer, VersionNumberLow, 0, LocalFileName, False, Enum_ReplaceModifiedFile, Enum_EOLNative, Enum_CompareFileByChecksum, Enum_SetLocalFileTimeCurrent, MergeParam, Cancelled, ResultDescription)
	If ResultValue <> 0 Then
		MsgBox ("Faild to get an old version of the file.")
	End If

End Sub