Description
Opens a source-controlled project for refreshing and rebuilding offline.
Syntax
INT PBORCA_SccConnectOffline ( HPBORCA hORCASession, PBORCA_SCC *pConfig );
Argument |
Description |
---|---|
hORCASession |
Handle to previously established ORCA session |
*pConfig |
Pointer to a preallocated structure typically initialized to zeros |
Return value
INT. Typical return codes are:
Return code |
Description |
---|---|
0 PBORCA_OK |
Operation successful |
-22 PBORCA_SCCFAILURE |
Could not connect to source control |
-23 PBORCA_REGREADERROR |
Could not read registry |
-24 PBORCA_LOADDLLFAILED |
Could not load DLL |
-25 PBORCA_SCCINITFAILED |
Could not initialize SCC connection |
-26 PBORCA_OPENPROJFAILED |
Could not open project |
Usage
This function is applicable only when PBORCA_SCC_IMPRORTONLY is specified on the subsequent PBORCA_SccSetTarget command.
Import-only processing assumes that all of the objects necessary to refresh a source-controlled target already exist on the local project path. Therefore, PBORCA_SccConnectOffline instantiates the ORCA source control class but does not actually connect to an SCC provider.
This function is particularly useful for developers who use laptop computers. While connected to the network, they can refresh their SCC client view. Then, during off hours, they can perform the time-consuming process of refreshing and rebuilding their application without the need for a network connection.
Examples
This example populates the PBORCA_SCC structure with connection information from the PocketBuilder qadb.pkw workspace file located in the current working directory. It then connects in offline mode and refreshes the qadbtest.pbt target that is located in the qadbtest subdirectory under the current working directory. Only objects that are out of sync will be refreshed. Objects checked out by the current user will not be overwritten:
PBORCA_SCC sccConfig; TCHAR szWorkSpace[PBORCA_SCC_PATH_LEN]; TCHAR szTarget[PBORCA_SCC_PATH_LEN]; LONG lFlags; memset(&sccConfig, 0x00, sizeof(PBORCA_SCC)); _tcscpy(szWorkSpace, _TEXT("qadb.pkw")); lpORCA_Info->lReturnCode = PBORCA_SccGetConnectProperties( lpORCA_Info->hORCASession, szWorkspace, &sccConfig); if (lpORCA_Info->lReturnCode == PBORCA_OK) { // Specify a different log file for the build operation _tcscpy(sccConfig.szLogFile, _TEXT("bldqadb.log")); sccConfig.lAppend = 0; lpORCA_Info->lReturnCode = PBORCA_SccConnectOffline( lpORCA_Info->hORCASession, &sccConfig); if (lpORCA_Info->lReturnCode == PBORCA_OK) { _tcscpy(szTarget, _TEXT("qadbtest\\qadbtest.pkt")); lFlags = PBORCA_SCC_IMPORTONLY | PBORCA_SCC_OUTOFDATE | PBORCA_SCC_EXCLUDE_CHECKOUT; lpORCA_Info->lReturnCode = PBORCA_SccSetTarget( lpORCA_Info->hORCASession, szTarget, lFlags, NULL, NULL); if (lpORCA_Info->lReturnCode == PBORCA_OK) { lpORCA_Info->lReturnCode = PBORCA_SccRefreshTarget( lpORCA_Info->hORCASession, PBORCA_FULL_REBUILD); } } }
See also