PBORCA_SccConnect

Description

Initializes source control and opens a project.

Syntax

INT PBORCA_SccConnect ( 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 method initializes a source control session based on the connection information supplied in the PBORCA_SCC structure. The PBORCA_SCC structure is defined as follows:

typedef struct pborca_scc 
{ 
   HWND hWnd; 
   TCHAR szProviderName [PBORCA_SCC_NAME_LEN + 1]; 
   LONG *plCapabilities; 
   TCHAR szUserID [PBORCA_SCC_USER_LEN + 1]; 
   TCHAR szProject [PBORCA_SCC_PATH_LEN + 1]; 
   TCHAR szLocalProjPath [PBORCA_SCC_PATH_LEN + 1]; 
   TCHAR szAuxPath [PBORCA_SCC_PATH_LEN + 1]; 
   TCHAR szLogFile [PBORCA_SCC_PATH_LEN + 1]; 
   LPTEXTOUTPROC pMsgHandler; 
   LONG *pCommentLen; 
   LONG lAppend; 
   LPVOID pCommBlk; 
} PBORCA_SCC;

You can either populate the structure manually or else call PBORCA_SccGetConnectProperties to obtain the connection information associated with a specific workspace file. This function:

  • Opens the requested source control project

  • Creates a CPB_OrcaSourceControl class that implements the PBORCA_SCC methods

  • Defines a runtime environment that persists until PBORCA_SccClose is called

The runtime environment has four subsystems: runtime engine (rt), object manager (ob), PowerScript compiler (cm), and storage manager (stg). The runtime environment is used to process the target identified by a subsequent PBORCA_SccSetTarget call. To process multiple targets, you must close the SCC connection, close the ORCA session, and open a new ORCA session.

Examples

The following example connects to PBNative source control:

PBORCA_SCC           sccConfig;
memset(&sccConfig, 0x00, sizeof(PBORCA_SCC));
//  Manually set up connection properties to PBNative
_tcscpy(sccConfig.szProviderName, _TEXT("PB Native"));
_tcscpy(sccConfig.szProject,
  _TEXT("c:\\PBNative_Archive\\qadb"));
_tcscpy(sccConfig.szUserID, _TEXT("Joe"));
_tcscpy(sccConfig.szLogFile, _TEXT("c:\\qadb\\orcascc.log"));
_tcscpy(sccConfig.szLocalProjPath, _TEXT("c:\\qadb"));
sccConfig.lAppend = 0;
lpORCA_Info->lReturnCode = PBORCA_SccConnect(  
   lpORCA_Info->hORCASession,
   &sccConfig);

See also

PBORCA_SccClose

PBORCA_SccConnectOffline

PBORCA_SccGetConnectProperties

PBORCA_SccSetTarget