cwbOBJ_CreateResourceHandle

Purpose

Create a resource handle for a particular AFP™ resource on a specified system.

Syntax

 
unsigned int CWB_ENTRY  cwbOBJ_CreateResourceHandle(
                               const char             *systemName,
                               const char             *resourceName,
                               const char             *resourceLibrary,
                               cwbOBJ_AFPResourceType  resourceType,
                               cwbOBJ_ObjHandle       *objectHandle,
                               cwbSV_ErrHandle         errorHandle);

Parameters

const char *systemName - input
Pointer to the system name contained in an ASCIIZ string.
const char *resourceName - input
Pointer to the name of the AFP resource.
const char *resourceLibrary - input
Pointer to the name of the iSeries™ library that contains the resource.
cwbOBJ_AFPResourceType resourceType - input
Specifies what type of resource this is. Must be one of the following:
  • CWBOBJ_AFPRSC_FONT
  • CWBOBJ_AFPRSC_FORMDEF
  • CWBOBJ_AFPRSC_OVERLAY
  • CWBOBJ_AFPRSC_PAGESEG
  • CWBOBJ_AFPRSC_PAGEDEF
cwbOBJ_ObjHandle *objectHandle - output
On output this will contain the resource handle.
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 temporary buffer.
CWB_INVALID_PARAMETER
Invalid parameter specified.
CWB_NON_REPRESENTABLE_UNICODE_CHAR
One or more input Unicode characters have no representation in the code page being used.
CWB_API_ERROR
General API failure.

Usage

Use this API to get a handle to a resource if you know the name library and type of resource. If you don't know either of these or want to choose from a list, use the list APIs to list AFP resources instead. This API does no checking of the AFP resource on the host. The first time this handle is used to retrieve data for the resource, a host error will be encountered if the resource file doesn't exist.