I am trying to use a Merrant Version manager application through VB 6. The .bas file which the version manager has,I have included as a module in my VB program. So I am just calling the function. The function is shown like the following in .bas file
Declare Function PvcsOpenArchive& Lib "VM32VBWRAP.DLL" Alias "_wPvcsOpenArchive@28" (filename As Any, workfile As Any, ByVal workfileLen&, archive As Any, ByVal archiveLen&, ByVal openFlags&, hArchive&) ' fileName$, ' I: Name of archive or workfile ' workfile$, ' O: Buffer reveiving name of workfile ' ByVal workfileLen&, ' I: Length of workfile buffer ' archive$, ' O: Buffer reveiving name of archive ' ByVal archiveLen&, ' I: Length of archive buffer ' ByVal openFlags&, ' I: see below ' hArchive&) ' O: Returned archive handle
I am trying to call it like this -
Dim hPVCS As Long Dim sBuffWorkfile As String Dim sBuffArchive As String Dim iStatus As Integer Dim sFile, sWorkfile As String
sFile = "\\10.20.9.212\qivr_vm8\QIVR_Vault_Projects\archives\IVRS Projects (Vault)\Sample_Project\test.txt-arc" sWorkfile = "C:\disha\test.txt" Open sWorkfile For Input As #1 Open sFile For Input As #2 iStatus = PvcsOpenArchive(sFile, sBuffWorkfile, LOF(1), sBuffArchive, LOF(2), PVCS_OPEN_RDONLY, hPVCS)
In the documentation its said that if the function ran successfully it will return 0 otherwise if the file is not found it will return 2. Using this function I should get a handle over the PVCS, so that I can use all the functions in it. But I have tried all the option. Even though the file is there, its returning me 2.
In documentation they have given an example of C It is like this
ARCHIVEHANDLE handle; char workfile[256]; char archive[256]; int status;
/* open archive for update */
PvcsOpenArchive("foo.c_v", /*Name of archive or workfile */ workfile,/* Buffer receiving name of workfile */ (workfile),/*Length of workfile buffer */ archive, /*Buffer receiving name of archive */ sizeof(archive), /*Length of archive buffer */ PVCS_OPEN_UPDATE,/* open archive for modification */ &handle);/* Returned archive handle */ PvcsCloseArchive(handle)
I am trying to use the same in VB 6 with little different values.
I have tried to double up on the "\" but still its not working.
I have tried this one also but still not successful
Dim hPVCS As Long Dim sBuffWorkfile As String * 256 Dim sBuffArchive As String * 256 Dim iStatus As Integer Dim sFile, sWorkfile As String
sFile = "\\10.20.9.212\qivr_vm8\QIVR_Vault_Projects\archives\IVRS Projects (Vault)\Sample_Project\test.txt-arc" iStatus = PvcsOpenArchive(sFile, sBuffWorkfile, Len(sBuffWorkfile), sBuffArchive, Len(sBuffArchive), PVCS_OPEN_RDONLY, hPVCS)
Can anybody please help me out
|
|