cwbOBJ_DisplayResource

Purpose

Displays the specified AFP™ resource to the user.

Syntax

 
unsigned int CWB_ENTRY  cwbOBJ_DisplayResource(
                               cwbOBJ_ObjHandle     resourceHandle,
                               const char          *view,
                               const unsigned long  flags,
                               cwbSV_ErrHandle      errorHandle);

Parameters

cwbOBJ_ObjHandle resourceHandle - input
Handle of the AFP Resource object. It must be an overlay or a pagesegment type of resource.
const char *view - input
Optional, may be NULL. If specified, it is a pointer to an ASCIIZ string that specifies the view to use when invoking the AFP viewer. There are two predefined views shipped with the viewer: LETTER (8.5" x 11") and SFLVIEW (132 column). Users may also add their own.
const unsigned long flags - input
Any of following bits may be set: CWBOBJ_DSPSPLF_WAIT - instructs this call to wait until the viewer process has successfully opened the resource before returning. If this bit is 0, this API will return after it starts the viewer process. If it is 1, this API will wait for the viewer to get the resource open before returning. All other bits must be set to 0.
cwbSV_ErrHandle errorHandle - output
Optional, may be 0. Any returned messages will be written to this object. It is created with the cwbSV_CreateErrHandle() API. The messages may be retrieved through the cwbSV_GetErrText() API. If the parameter is set to zero, no messages will be retrievable.

Return Codes

The following list shows common return values.

CWB_OK
Successful completion.
CWB_NOT_ENOUGH_MEMORY
Insufficient memory; may have failed to allocate a temporary buffer.
CWB_INVALID_HANDLE
Handle is not an allocated object handle.
CWB_NO_VIEWER
The viewer support for ClientAccess/400 was not installed.
CWB_NON_REPRESENTABLE_UNICODE_CHAR
One or more input Unicode characters have no representation in the code page that is being used.
CWB_API_ERROR
General API failure.
CWBOBJ_RC_INVALID_TYPE
The handle given for resourceHandle is not a handle to an overlay or pagesegment resource.

Usage

Use this API to bring up the AFP viewer on the specified AFP resource. The type of the resource must be an overlay or a pagesegment. A return code of CWB_NO_VIEWER means that the viewer component was not installed on the workstation.