PBORCA_DynamicLibraryCreate
Description
Creates a PowerBuilder dynamic library (PBD) or PowerBuilder
DLL.
Syntax
|
1 2 3 4 5 6 |
INT PBORCA_DynamicLibraryCreate ( HPBORCA hORCASession, LPTSTR lpszLibraryName, LPTSTR lpszPBRName, LONG lFlags, LPVOID pbcPara = NULL ); |
|
Argument |
Description |
|---|---|
|
hORCASession |
Handle to previously established ORCA |
|
lpszLibraryName |
Pointer to a string whose value is the file name of |
|
lpszPBRName |
Pointer to a string whose value is the name of a |
|
lFlags |
A long value that indicates which code generation Setting For |
|
pbcPara |
Reserved for internal use. Always set pbcPara to |
Return value
INT. The typical return codes are:
|
Return code |
Description |
|---|---|
|
0 PBORCA_OK |
Operation successful |
|
-1 PBORCA_INVALIDPARMS |
Invalid parameter list |
|
-4 PBORCA_BADLIBRARY |
Bad library name |
|
-17 PBORCA_PBDCREATERROR |
PBD create error |
Usage
Before calling this function, you must have previously set the
library list and current application.
If you plan to build an executable in which some of the libraries
are dynamic libraries, you must build those dynamic libraries before
building the executable.
Location and name of file
The resulting PBD or DLL will be created in the same directory using
the same file name as the PBL. Only the extension changes. For example,
for a library C:DIR1DIR2PROG.PBL:
-
The output for Pcode is C:DIR1DIR2PROG.PBD
-
The output for machine code is C:DIR1DIR2PROG.DLL
eClobber settings
If the PBD or DLL already exists in the file system, the current
setting of the eClobber property in the ORCA configuration block (that you
set with a PBORCA_ConfigureSession call) determines whether
PBORCA_DynamicLibraryCreate succeeds or fails.
|
Current eClobber setting |
PBORCA_DynamicLibraryCreate |
|---|---|
|
PBORCA_NOCLOBBER |
Fails when an executable file already exists in the |
|
PBORCA_CLOBBER or |
Succeeds when the existing executable file has |
|
PBORCA_CLOBBER_ALWAYS |
Succeeds regardless of the file attribute settings of |
Examples
This example builds a machine code DLL from the library PROCESS.PBL.
It is optimized for speed with trace and error context information:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
LPTSTR pszLibFile; LPTSTR pszResourceFile; long lBuildOptions; int rtn; // copy file names pszLibFile = _TEXT("c:\app\process.pbl"); pszResourceFile = _TEXT("c:\app\process.pbr"); lBuildOptions = PBORCA_MACHINE_CODE_NATIVE | PBORCA_MACHINE_CODE_OPT_SPEED | PBORCA_TRACE_INFO | PBORCA_ERROR_CONTEXT; // create DLL from library rtn = PBORCA_DynamicLibraryCreate( lpORCA_Info->hORCASession, pszLibFile, pszResourceFile, lBuildOptions, NULL ); |
In these examples, session information is saved in the data
structure ORCA_Info, shown in About the examples.
See also