Page 1 of 1
Problem with SccQueryInfo MSSCCI Interface
Posted: Tue Feb 16, 2010 1:56 am
by coderanger
I had written my own web site editor and it used the MSSCCI interface to work with SourceSafe. We have now bought SourceGear and the Vault VS2005 Compatible Client (which adheres to this interface) isnt working right.
Basically my call to SccQueryInfo to get the status of all the files is just returning "-1" for each array item and I cannot work out why, it works perfectly with SourceSafe but connecting via Vault doesnt work. It returns back SCOK but the array is wrong.
Can anyone confirm this part of the interface is working as it should, or perhaps give me some clues to try. I have tried just passing an array of filenames only as well as an array of full file paths.
Any help would be sooo appreciated.
Re: Problem With MSSCCI Interface
Posted: Tue Feb 16, 2010 1:46 pm
by lbauer
What version of Vault are you using?
Are you using Visual Studio, or just calling the plugin?
VS2005 Compatible Client
Do you mean the VS 2003 compatible client, or Classic Client?
Re: Problem With MSSCCI Interface
Posted: Wed Feb 17, 2010 1:56 am
by coderanger
Sorry, the MSSCCI interface which is the "SourceGear Vault VS2003 Compatible Client"
Re: Problem With MSSCCI Interface
Posted: Wed Feb 17, 2010 11:35 am
by lbauer
Are there any errors in the Vault Server log or in the Event Viewer when you try to use your interface?
What version of Vault are you using?
Are you using Visual Studio, or just calling the plugin?
Re: Problem With MSSCCI Interface
Posted: Wed Feb 17, 2010 12:54 pm
by coderanger
To answer your questions:
* Nothing is being shown in the sgvault.log file at all, just my successful login and nothing else. The event viewer logs are also empty.
* I am using the very latest version of Vault 5 (I only downloaded it last week).
* The MSSCCI interface is the "SourceGear Vault VS2003 Compatible Client".
* As above, I am using a web site editor I have written (not visual studio) and it uses the MSSCCI interface for source control. It works/worked fine with SourceSafe and SourceOffsite, but with Vault I am getting an erroneous result with SccQueryInfo.
Basically here is my code, it wont mean much and stuff has been cut out but you will get the basic idea:
Code: Select all
typedef SCCRTN (*funcSccQueryInfo)(
__inout LPVOID pContext,
__in LONG nFiles,
__in_ecount(nFiles) LPCSTR* lpFileNames,
__out_ecount(nFiles) LPLONG lpStatus
);
funcSccQueryInfo m_pSccQueryInfo;
m_pSccQueryInfo = (funcSccQueryInfo)GetProcAddress( m_hSccLibrary, _T("SccQueryInfo") );
Container::CXArray< LONG > arrStatus;
Container::CXArray< LPCSTR > arrData;
for( UINT u = 0; u < arr.GetSize(); u++ )
{
LPCSTR lpDocPath = (LPCSTR)arr.GetAt( u );
arrData.Add( lpDocPath );
arrStatus.Add( SCC_STATUS_INVALID );
}
long lResult = m_pSccQueryInfo(
m_pSccLibraryContext, // __inout LPVOID pContext,
arrData.GetSize(), // __in LONG nFiles,
arrData.GetData(), // __in_ecount(nFiles) LPCSTR* lpFileNames,
arrStatus.GetData() // __out_ecount(nFiles) LPLONG lpStatus
);
if( lResult == SCC_OK )
{
for( UINT u = 0; u < arrData.GetSize(); u++ )
{
CProjectFile *pFile = NULL;
if( mapFilePaths.Lookup( arrData.GetAt( u ), pFile ) )
{
// ERROR: The following is always returning -1 with Vault...
pFile->m_nSccStatus = arrStatus[ u ];
}
}
}
Re: Problem With MSSCCI Interface
Posted: Wed Feb 17, 2010 2:34 pm
by coderanger
I found the problem which seems odd, I was setting the array of longs to:
Code: Select all
arrStatus.Add( SCC_STATUS_INVALID );
It works if I set it to:
Code: Select all
arrStatus.Add( SCC_STATUS_NOTCONTROLLED );
Please pass this on as a bit of an oddity as it shouldnt really behave like this I would have thought.
Re: Problem With MSSCCI Interface
Posted: Thu Feb 18, 2010 7:38 am
by lbauer
Thanks for the info; I'll pass it on to our developers. It may be a bug, or it could be that we implement our interface with MSSCCI differently than SOS or VSS.
Re: Problem With MSSCCI Interface
Posted: Thu Feb 18, 2010 12:29 pm
by coderanger
Yes it is undefined as to what should be passed in, but regardless of what is passed in, the correct values should be returned so I would assume that this is a bug.