PBORCA_SessionSetCurrentAppl

Description

Establishes the current Application object for an ORCA session.

Syntax

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

Argument

Description

hORCASession

Handle to previously established ORCA session

lpszApplLibName

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

lpszApplName

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


Return value

INT. Typical return codes are:

Return code

Description

0       PBORCA_OK

Operation successful

-1      PBORCA_INVALIDPARMS

Invalid parameter list

-2      PBORCA_DUPOPERATION

Current application is already set

-3      PBORCA_OBJNOTFOUND

Referenced library does not exist

-4      PBORCA_BADLIBRARY

Bad library name

-5      PBORCA_LIBLISTNOTSET

Library list not set

-6      PBORCA_LIBNOTINLIST

Referenced library not in library list


Usage

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.

Examples

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(
   lpORCA_Info->hORCASession,
   pszLibraryName, pszApplName);

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

See also

PBORCA_SessionSetLibraryList