Why MSSCCI checkout function not work?

Hi, all. I'm using SCC API to implement one SCC provider. When I do check out operation, and set file status in SccQueryInfo() function to SCC_STATUS_CONTROLLED  | SCC_STATUS_CHECKEDOUT, the file icon still locks, not checkout. But if I use SCC_STATUS_CONTROLLED  | SCC_STATUS_OUTOTHER, the icon is a user, it works. I'm using VS2005 and VSSDK2006.04.
Here is my code:

SCCEXTERNC SCCRTN EXTFUN __cdecl SccQueryInfo(
 LPVOID pContext,
 LONG nFiles,
 LPCSTR* lpFileNames,
 LPLONG lpStatus
 )
{
 for(int i = 0;i<nFiles;i++)
 {
  lpStatus[ i ] = SCC_STATUS_CONTROLLED  | SCC_STATUS_CHECKEDOUT;
 } 

 return SCC_OK;
}

This code is only for test Checkout function.

Thank you all!

 



Answer this question

Why MSSCCI checkout function not work?

  • Muhammad Abrar

    Do the SDK SCC samples show this issue

  • GKM

    Working folder is a SourceSafe concept, it describes the default folder where a file is expected to be on disk. Not all providers allow arbitrary places for files, so it's up to you how you're going to implement it for yours.

    I'll give you an example to make that clearer:

    Let's say in SourceSafe you have a file in the database $/foo/bar.txt You can set a working folder to it, let's say it's c:\sources. This means that by default SourceSafe will get or checkout the bar.txt to c:\sources\bar.txt but you could tell it through the UI to check it out in some other places, like c:\temp\bar.txt. In the first case it's considered to be checked out in the working folder and SCC_STATUS_CHECKEDOUT | SCC_STATUS_OUTBYUSER will be returned. For the c:\temp\bar.txt only SCC_STATUS_OUTBYUSER will be returned.

    In brief, think of SCC_STATUS_OUTBYUSER as the flag saying if the file is checked out at all or not and for SCC_STATUS_CHECKEDOUT as giving some additional info as to where exactly is the file checked out. As I said, the names of the flags don't reflect their meaning very well.


  • K.Murugan

    Thank you Milen Lazarov! I'm trying this but I don't know how to set working directory. Does any cap or option I must set

    MSSCCI sample is a framework only and the code provided is simple.


  • Andreas Hofer

    Milen Lazarov, thank you very much. Your answer is very clear and helpful. It works fine according to your rule now. Thank you!
  • kasl33

    The meaning of the status flags for checkout is somehow disconnected from their names, unfortunately. Please, follow the rules below:

    MSSCCI status requirements:
    1) SCC_STATUS_OUTBYUSER is set when the current user has the file
    checked-out.
    2) SCC_STATUS_CHECKEDOUT cannot be set unless SCC_STATUS_OUTBYUSER
    is set.
    3) SCC_STATUS_CHECKEDOUT is only set when the file is checked-out into
    the designated working directory.
    4) If the file is checked-out by the current user into a directory
    other than the working directory, SCC_STATUS_OUTBYUSER is set but
    SCC_STATUS_CHECKEDOUT is not.

    -Milen Lazarov


  • Why MSSCCI checkout function not work?