PBORCA_SessionSetLibraryList

Description

Establishes the list of libraries for an ORCA session. ORCA searches the libraries in the list to resolve object references.

Syntax

INT PBORCA_SessionSetLibraryList ( HPBORCA hORCASession, 
   LPTSTR *pLibNames, 
   INT iNumberOfLibs );

Argument

Description

hORCASession

Handle to previously established ORCA session.

*pLibNames

Pointer to an array of pointers to strings. The values of the strings are file names of libraries. Include the full path for each library where possible.

iNumberOfLibs

Number of library name pointers in the array pLibNames points to.


Return value

INT. Typical return codes are:

Return code

Description

0 PBORCA_OK

Operation successful

-1 PBORCA_INVALIDPARMS

Invalid parameter list

-4 PBORCA_BADLIBRARY

Bad library name or a library on the list does not exist


Usage

You must call PBORCA_SessionSetLibraryList and PBORCA_SessionSetCurrentAppl before calling any ORCA function that compiles or queries objects.

Library names should be fully qualified wherever possible.

Changing the library list

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

How ORCA uses the library list

ORCA uses the search path to find referenced objects when you regenerate or query objects during an ORCA session. Just like PowerBuilder, ORCA looks through the libraries in the order in which they are specified in the library search path until it finds a referenced object.

Functions that don't need a library list

You can call the following library management functions and source control functions without setting the library list:

PBORCA_LibraryCommentModify

PBORCA_LibraryCreate

PBORCA_LibraryDelete

PBORCA_LibraryDirectory

PBORCA_LibraryEntryCopy

PBORCA_LibraryEntryDelete

PBORCA_LibraryEntryExport

PBORCA_LibraryEntryInformation

PBORCA_LibraryEntryMove

Examples

This example builds an array of library file names for PocketBuilder and sets the session's library list:

LPTSTR lpLibraryNames[4];
// specify the library names
lpLibraryNames[0] =
   _TEXT("c:\\qadb\\qadbtest\\qadbtest.pkl");
lpLibraryNames[1] =
   _TEXT("c:\\qadb\\shared_obj\\shared_obj.pkl");
lpLibraryNames[2] =
   _TEXT("c:\\qadb\\chgreqs\\chgreqs.pkl");
lpLibraryNames[3] =
   _TEXT("c:\\qadb\\datatypes\\datatypes.pkl");
lpORCA_Info->lReturnCode = PBORCA_SessionSetLibraryList(
   lpORCA_Info->hORCASession, lpLibraryNames, 4);

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

See also

PBORCA_SessionSetCurrentAppl