PBORCA_ConfigureSession
Description
PBORCA_ConfigureSession facilitates backward compatibility with
PowerBuilder 10. It increases the flexibility of the API and minimizes the
changes necessary to other ORCA function signatures.
Syntax
|
1 |
INT PBORCA_ConfigureSession ( PBORCA hORCASession, PPBORCA_CONFIG_SESSION pSessionConfig ); |
|
Argument |
Description |
|---|---|
|
hORCASession |
Handle to previously established ORCA |
|
pSessionConfig |
Structure that lets the ORCA client specify the |
Return value
INT. Typical return codes are:
|
Return code |
Description |
|---|---|
|
0 PBORCA_OK |
Operation successful |
|
-1 PBORCA_INVALIDPARMS |
Session not open or null pConfig |
Usage
Create an instance of a PBORCA_CONFIG_SESSION structure and populate
it with your configuration settings. Then call PBORCA_ConfigureSession
immediately after SessionOpen. You can also call this function anytime
thereafter to reset configuration properties.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
typedef enum pborca_clobber { PBORCA_NOCLOBBER, PBORCA_CLOBBER, PBORCA_CLOBBER_ALWAYS PBORCA_CLOBBER_DECIDED_BY_SYSTEM } PBORCA_ENUM_FILEWRITE_OPTION; typedef enum pborca_type { PBORCA_UNICODE, PBORCA_UTF8, PBORCA_HEXASCII, PBORCA_ANSI_DBCS } PBORCA_ENCODING; typedef struct pborca_configsession { PBORCA_ENUM_FILEWRITE_OPTION eClobber; // overwrite existing file? PBORCA_ENCODING eExportEncoding; // Encoding of exported source BOOL bExportHeaders; // Format source with export header BOOL bExportIncludeBinary; // Include the binary BOOL bExportCreateFile; // Export source to a file LPTSTR pExportDirectory; // Directory for exported files PBORCA_ENCODING eImportEncoding; // Encoding of imported source BOOL bDebug; // Debug compiler directive PVOID filler2;// Reserved for future use PVOID filler3; PVOID filler4; } PBORCA_CONFIG_SESSION, FAR *PPBORCA_CONFIG_SESSION; |
|
Member variable |
Description |
|---|---|
|
eClobber |
Specifies when to overwrite existing files on the PBORCA_LibraryEntryExport PBORCA_LibraryEntryExportEx PBORCA_DynamicLibraryCreate PBORCA_ExecutableCreate PBORCA_LibraryDelete You
|
|
eExportEncoding |
Specifies the source encoding used by
|
|
bExportHeaders |
If you set this variable to TRUE, |
|
bExportIncludeBinary |
If you set this variable to TRUE, |
|
bExportCreateFile |
If you set this variable to TRUE, |
|
pExportDirectory |
Directory where you export PowerBuilder objects if |
|
eImportEncoding |
Source encoding. Subsequent calls to |
|
bDebug |
If you set this value to FALSE, the DEBUG conditional |
Examples
This example populates the PBORCA_CONFIG_SESSION structure with
configuration settings:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
INT ConfigureSession(LPTSTR sEncoding) { INT iErrCode = -1; lpORCA_Info->pConfig = (PPBORCA_CONFIG_SESSION) malloc(sizeof(PBORCA_CONFIG_SESSION)); memset(lpORCA_Info->pConfig, 0, sizeof(PBORCA_CONFIG_SESSION)); if (!_tcscmp(sEncoding, _TEXT("ANSI"))) { lpORCA_Info->pConfig->eExportEncoding = PBORCA_ANSI_DBCS; lpORCA_Info->pConfig->eImportEncoding = PBORCA_ANSI_DBCS; } else if (!_tcscmp(sEncoding, _TEXT("UTF8"))) { lpORCA_Info->pConfig->eExportEncoding = PBORCA_UTF8; lpORCA_Info->pConfig->eImportEncoding = PBORCA_UTF8; } else if (!_tcscmp(sEncoding, _TEXT("HEXASCII"))) { lpORCA_Info->pConfig->eExportEncoding = PBORCA_HEXASCII; lpORCA_Info->pConfig->eImportEncoding = PBORCA_HEXASCII; } else { lpORCA_Info->pConfig->eExportEncoding = PBORCA_UNICODE; lpORCA_Info->pConfig->eImportEncoding = PBORCA_UNICODE; } lpORCA_Info->pConfig->eClobber = PBORCA_CLOBBER; lpORCA_Info->pConfig->bExportHeaders = TRUE; lpORCA_Info->pConfig->bExportIncludeBinary = FALSE; lpORCA_Info->pConfig->bExportCreateFile = FALSE; lpORCA_Info->pConfig->pExportDirectory = NULL; lpORCA_Info->pConfig->bDebug = FALSE; iErrCode = PBORCA_ConfigureSession( lpORCA_Info->hORCASession, lpORCA_Info->pConfig); return iErrCode; } |
See also