Problem with SccQueryInfo MSSCCI Interface

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
coderanger
Posts: 35
Joined: Mon Feb 15, 2010 6:11 pm

Problem with SccQueryInfo MSSCCI Interface

Post by coderanger » Tue Feb 16, 2010 1:56 am

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.
Last edited by coderanger on Thu Feb 18, 2010 12:37 pm, edited 1 time in total.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Problem With MSSCCI Interface

Post by lbauer » Tue Feb 16, 2010 1:46 pm

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?
Linda Bauer
SourceGear
Technical Support Manager

coderanger
Posts: 35
Joined: Mon Feb 15, 2010 6:11 pm

Re: Problem With MSSCCI Interface

Post by coderanger » Wed Feb 17, 2010 1:56 am

Sorry, the MSSCCI interface which is the "SourceGear Vault VS2003 Compatible Client"

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Problem With MSSCCI Interface

Post by lbauer » Wed Feb 17, 2010 11:35 am

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?
Linda Bauer
SourceGear
Technical Support Manager

coderanger
Posts: 35
Joined: Mon Feb 15, 2010 6:11 pm

Re: Problem With MSSCCI Interface

Post by coderanger » Wed Feb 17, 2010 12:54 pm

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 ];
		}
	}
}

coderanger
Posts: 35
Joined: Mon Feb 15, 2010 6:11 pm

Re: Problem With MSSCCI Interface

Post by coderanger » Wed Feb 17, 2010 2:34 pm

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.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Problem With MSSCCI Interface

Post by lbauer » Thu Feb 18, 2010 7:38 am

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.
Linda Bauer
SourceGear
Technical Support Manager

coderanger
Posts: 35
Joined: Mon Feb 15, 2010 6:11 pm

Re: Problem With MSSCCI Interface

Post by coderanger » Thu Feb 18, 2010 12:29 pm

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.

Post Reply