Establishes the current Application object for an ORCA session.


INT PBORCA_SessionSetCurrentAppl ( HPBORCA hORCASession,
   LPTSTR lpszApplLibName, LPTSTR lpszApplName );




Handle to previously established ORCA session


Pointer to a string whose value is the name of the application library


Pointer to a string whose value is the name of the Application object

Return value

INT. Typical return codes are:

Return code


0       PBORCA_OK

Operation successful


Invalid parameter list


Current application is already set


Referenced library does not exist


Bad library name


Library list not set


Referenced library not in library list


You must set the library list before setting the current application.

You must call PBORCA_SessionSetLibraryList and then PBORCA_SessionSetCurrentAppl before calling any ORCA function that compiles or queries objects. The library name should include the full path for the file wherever possible.

Changing the application

You can set the library list and current application only once in a session. If you need to change the current application after it has been set, close the session and open a new session.

New applications

To create a new application starting with an empty library, set the pointers to the application library name and the application name to NULL. ORCA will set up an internal default application.

For more information about creating a new application, see Bootstrapping a new application.


This example sets the current Application object to the object named demo in the library MASTER.PBL:

LPTSTR pszLibraryName;
LPTSTR pszApplName;
// specify library name
pszLibraryName = _TEXT("c:\\app\\master.pbl");
// specify application name
pszApplName = _TEXT("demo");
// set the current Application object
lpORCA->lReturnCode = PBORCA_SessionSetCurrentAppl(
   pszLibraryName, pszApplName);

In these examples, session information is saved in the data structure ORCA_Info, shown in About the examples.

See also