QUERYCHANGESFUNC

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at QUERYCHANGESFUNC.

This is a callback function used by the SccQueryChanges operation to enumerate a collection of file names and determine each file's status.

The SccQueryChanges function is given a list of files and a pointer to the QUERYCHANGESFUNC callback. The source control plug-in enumerates over the given list and provides status (via this callback) for each file in the list.

typedef BOOL (*QUERYCHANGESFUNC)(  
   LPVOID pvCallerData,  
   QUERYCHANGESDATA * pChangesData  
);  

pvCallerData
[in] The pvCallerData parameter passed by the caller (the IDE) to SccQueryChanges. The source control plug-in should make no assumptions about the contents of this value.

pChangesData
[in] Pointer to a QUERYCHANGESDATA Structure structure describing the changes to a file.

The IDE returns an appropriate error code:

ValueDescription
SCC_OKContinue processing.
SCC_I_OPERATIONCANCELEDStop processing.
SCC_E_xxxAny appropriate SCC error should stop processing.

The structure passed in for each file looks like the following:

struct QUERYCHANGESDATA_A  
{  
    DWORD  dwSize;  
    LPCSTR lpFileName;  
    DWORD  dwChangeType;  
    LPCSTR lpLatestName;  
};  
  
typedef struct QUERYCHANGESDATA_A QUERYCHANGESDATA;  
  
struct QUERYCHANGESDATA_W  
{  
    DWORD   dwSize;  
    LPCWSTR lpFileName;  
    DWORD   dwChangeType;  
    LPCWSTR lpLatestName;  
};  

dwSize
Size of this structure (in bytes).

lpFileName
The original file name for this item.

dwChangeType
Code indicating status of the file:

CodeDescription
SCC_CHANGE_UNKNOWNCannot tell what has changed.
SCC_CHANGE_UNCHANGEDNo name changes for this file.
SCC_CHANGE_DIFFERENTFile with a different identity, but the same name exists in the database.
SCC_CHANGE_NONEXISTENTFile does not exist either in the database or locally.
SCC_CHANGE_DATABASE_DELETEDFile deleted in the database.
SCC_CHANGE_LOCAL_DELETEDFile deleted locally but the file still exists in the database. If this cannot be determined, return SCC_CHANGE_DATABASE_ADDED.
SCC_CHANGE_DATABASE_ADDEDFile added to the database but does not exist locally.
SCC_CHANGE_LOCAL_ADDEDFile does not exist in database and is a new local file.
SCC_CHANGE_RENAMED_TOFile renamed or moved in the database as lpLatestName.
SCC_CHANGE_RENAMED_FROMFile renamed or moved in the database from lpLatestName; if this is too expensive to track, return a different flag, such as SCC_CHANGE_DATABASE_ADDED.

lpLatestName
The current file name for this item.

Callback Functions Implemented by the IDE
SccQueryChanges
Error Codes

Show: