Description
Queries a PowerBuilder object to get a list of its references to other objects.
Syntax
INT PBORCA_ObjectQueryReference ( HPBORCA hORCASession, LPTSTR lpszLibraryName, LPTSTR lpszEntryName, PBORCA_TYPE otEntryType, PBORCA_REFPROC pRefProc, LPVOID pUserData );
Argument |
Description |
---|---|
hORCASession |
Handle to previously established ORCA session. |
lpszLibraryName |
Pointer to a string whose value is the file name of the library containing the object being queried. |
lpszEntryName |
Pointer to a string whose value is the name of the object being queried. |
otEntryType |
A value of the PBORCA_TYPE enumerated data type specifying the object type of the entry being queried. Values are: PBORCA_APPLICATION PBORCA_DATAWINDOW PBORCA_FUNCTION PBORCA_MENU PBORCA_QUERY PBORCA_STRUCTURE PBORCA_USEROBJECT PBORCA_WINDOW PBORCA_PIPELINE PBORCA_PROJECT PBORCA_PROXYOBJECT |
pRefProc |
Pointer to the PBORCA_ObjectQueryReference callback function. The callback function is called for each referenced object. The information ORCA passes to the callback function is the referenced object name, its library, and its object type, stored in a structure of type PBORCA_REFERENCE. |
pUserData |
Pointer to user data to be passed to the PBORCA_ObjectQueryReference callback function. The user data typically includes the buffer or a pointer to the buffer in which the callback function stores the object information as well as information about the size of the buffer. |
Return value
INT. Typical return codes are:
Return code |
Description |
---|---|
0 PBORCA_OK |
Operation successful |
-1 PBORCA_INVALIDPARMS |
Invalid parameter list |
-3 PBORCA_OBJNOTFOUND |
Object not found |
-4 PBORCA_BADLIBRARY |
Bad library name |
-5 PBORCA_LIBLISTNOTSET |
Library list not set |
-6 PBORCA_LIBNOTINLIST |
Library not in library list |
-9 PBORCA_INVALIDNAME |
Name does not follow PowerBuilder naming rules |
Usage
You must set the library list and current Application object before calling this function.
Examples
This example queries the window object w_processdata in the library WINDOWS.PBL to get a list of its referenced objects. For each object that w_processdata references, PBORCA_ObjectQueryReference calls the callback ObjectQueryReference. In the code you write for ObjectQueryReference, you store the object name in the buffer pointed to by lpUserData. In the example, the lpUserData buffer has already been set up:
PBORCA_REFPROC fpRefProc; fpRefProc = (PBORCA_REFPROC) GetReferences; lpORCA_Info->lReturnCode = PBORCA_ObjectQueryReference( lpORCA_Info->hORCASession, _TEXT("c:\\app\\windows.pbl"), _TEXT("w_processdata"), PBORCA_WINDOW, fpRefProc, lpUserData );
For more information about setting up the data buffer for the callback, see Content of a callback function and the example for PBORCA_LibraryDirectory.
In these examples, session information is saved in the data structure ORCA_Info, shown in About the examples.
See also