G
Guest
I want to rewrite the follwoing VB6 code in manged C++. Any suggestions on how to start would be greatly appreciated. Thanks.
The code:
On Error GoTo ErrorHandler
Dim strArgs() As String
strArgs = Split(Command$, " ")
If (UBound(strArgs) <> 3) Then Err.Raise 9999, "Program", "Usage: VssExtract.exe [VSS_PATH] [USER] [PASSWORD] [EXTRACT_PATH] <VSS_PROJECT>"
Dim strVssPath As String
Dim strUser As String
Dim strPassword As String
Dim strExtractPath As String
Dim strVssProject As String
strVssPath = strArgs(0)
strUser = strArgs(1)
strPassword = strArgs(2)
strExtractPath = strArgs(3)
If (UBound(strArgs) = 4) Then
strVssProject = strArgs(4)
Else
strVssProject = "$/"
End If
Dim vssDB As SourceSafeTypeLib.VSSDatabase
Set vssDB = New SourceSafeTypeLib.VSSDatabase
vssDB.Open strVssPath, strUser, strPassword
Dim vssProject As SourceSafeTypeLib.VSSItem
Set vssProject = vssDB.VSSItem(strVssProject, False)
vssProject.Get strExtractPath, VSSFLAG_RECURSYES + VSSFLAG_FORCEDIRNO + VSSFLAG_TIMENOW
ErrorHandler:
Erase strArgs
Set vssProject = Nothing
Set vssDB = Nothing
If (Err.Number <> 0) Then
App.LogEvent "Error (" & Err.Number & "): " & Err.Description, 1
ExitProcess (Err.Number)
End If
End
The code:
On Error GoTo ErrorHandler
Dim strArgs() As String
strArgs = Split(Command$, " ")
If (UBound(strArgs) <> 3) Then Err.Raise 9999, "Program", "Usage: VssExtract.exe [VSS_PATH] [USER] [PASSWORD] [EXTRACT_PATH] <VSS_PROJECT>"
Dim strVssPath As String
Dim strUser As String
Dim strPassword As String
Dim strExtractPath As String
Dim strVssProject As String
strVssPath = strArgs(0)
strUser = strArgs(1)
strPassword = strArgs(2)
strExtractPath = strArgs(3)
If (UBound(strArgs) = 4) Then
strVssProject = strArgs(4)
Else
strVssProject = "$/"
End If
Dim vssDB As SourceSafeTypeLib.VSSDatabase
Set vssDB = New SourceSafeTypeLib.VSSDatabase
vssDB.Open strVssPath, strUser, strPassword
Dim vssProject As SourceSafeTypeLib.VSSItem
Set vssProject = vssDB.VSSItem(strVssProject, False)
vssProject.Get strExtractPath, VSSFLAG_RECURSYES + VSSFLAG_FORCEDIRNO + VSSFLAG_TIMENOW
ErrorHandler:
Erase strArgs
Set vssProject = Nothing
Set vssDB = Nothing
If (Err.Number <> 0) Then
App.LogEvent "Error (" & Err.Number & "): " & Err.Description, 1
ExitProcess (Err.Number)
End If
End