Download Parallel Crystal Developers Manual
Transcript
PEHANDLE gwHandle;
char pHost = HostDialog();
DWORD dwWait = WaitDialog();
/* Must call PEInitialize with PE_NO_CONNECT.*/
PEInitialize(NULL, NULL, 0, NULL, PE_NO_CONNECT);
/* Get Gateway handle and set "host" "wait" properties. */
gwHandle = PEGetGateway();
if ( !PEGatewaySetHost(gwHandle, pHost) ) {
ReportError(); goto close;
}
if ( !PEGatewaySetWait(gwHandle, dwWait) ) {
ReportError(); goto close;
}
/* Connect to Report Server on "host". */
if ( !PEConnect() ) {
ReportError(); goto close;
}
/* Complete initialization. */
if ( !PEInitAPI("PCREAPI") ) {
ReportError(); goto close;
}
/* Other API calls ... */
close:
PEUninitialize();
The set-functions set properties that affect the client connection to the Report Server.
Therefore, it makes no sense to call them after a call to PEConnect, so the following code
will generate an error message:
PEHANDLE gwHandle;
BOOL bOK;
/* Connect to "butterfly" host. */
PEInitRemote("butterfly.acme.com");
/* Get Gateway handle. */
gwHandle = PEGetGateway();
/* Following call generates an error! */
if ( !PEGatewaySetWait(gwHandle, 120) ) {
ReportError(); goto close;
}
Parallel Crystal Developer's Manual
Version 2.4 - Revised 5/27/00
262