Description
Compiles an object in a PowerBuilder library.
Syntax
INT PBORCA_CompileEntryRegenerate ( PBORCA hORCASession, LPTSTR lpszLibraryName, LPTSTR lpszEntryName, PBORCA_TYPE otEntryType, PBORCA_ERRPROC pCompErrorProc, 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 to be compiled. |
lpszEntryName |
Pointer to a string whose value is the name of the object to be compiled. |
otEntryType |
A value of the PBORCA_TYPE enumerated data type specifying the object type of the entry being compiled. Values are: PBORCA_APPLICATION PBORCA_DATAWINDOW PBORCA_FUNCTION PBORCA_MENU PBORCA_QUERY PBORCA_STRUCTURE PBORCA_USEROBJECT PBORCA_WINDOW PBORCA_PIPELINE PBORCA_PROJECT PBORCA_PROXYOBJECT |
pCompErrorProc |
Pointer to the PBORCA_CompileEntryRegenerate callback function. The callback function is called for each error that occurs as the object is compiled. The information ORCA passes to the callback function is error level, message number, message text, line number, and column number, stored in a structure of type PBORCA_COMPERR. The object name and script name are part of the message text. If you don't want to use a callback function, set pCompErrorProc to 0. |
pUserData |
Pointer to user data to be passed to the PBORCA_CompileEntryRegenerate callback function. The user data typically includes the buffer or a pointer to the buffer in which the callback function stores the error information as well as information about the size of the buffer. If you are not using a callback function, set pUserData to 0. |
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 |
-7 PBORCA_LIBIOERROR |
Library I/O error |
-11 PBORCA_COMPERROR |
Compile error |
Usage
You must set the library list and current Application object before calling this function.
When errors occur
In order to fix errors that occur during the regeneration, you need to export the source code, fix the errors, and import the object, repeating the process until it compiles correctly.
Sometimes you can open objects with minor errors in a PowerBuilder painter and fix them, but an object with major errors must be exported and fixed.
For information about callback processing for errors, see PBORCA_CompileEntryImportList.
Examples
This example compiles a DataWindow called d_labels in the library DWOBJECTS.PBL.
Each time an error occurs, PBORCA_CompileEntryRegenerate calls the callback CompileEntryErrors. In the code you write for CompileEntryErrors, you store the error messages in the buffer pointed to by lpUserData. In the example, the lpUserData buffer has already been set up:
PBORCA fpError; int nReturnCode; fpError = (PBORCA_ERRPROC) ErrorProc; nReturnCode = PBORCA_CompileEntryRegenerate( lpORCA_Info->hORCASession, _TEXT("c:\\app\\dwobjects.pbl"), _TEXT("d_labels"), PBORCA_DATAWINDOW, fpError, lpUserData );
In these examples, session information is saved in the data structure ORCA_Info, shown in About the examples.
See also