cwbOBJ_CloseResource

Purpose

Closes an AFP™ Resource object that was previously opened for reading.

Syntax

 
unsigned int CWB_ENTRY  cwbOBJ_CloseResource(
                               cwbOBJ_ObjHandle   resourceHandle,
                               cwbSV_ErrHandle    errorHandle);

Parameters

cwbOBJ_ObjHandle resourceHandle - input
Handle of the resource to be closed.
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_NO_ERROR
Successful completion.
CWB_NOT_ENOUGH_MEMORY
Insufficient memory.
CWB_INVALID_HANDLE
Handle is not valid resource handle.
CWBOBJ_RC_HOST_ERROR
Host error occurred. Text may be in errorHandle.
CWBOBJ_RC_RSCNOTOPEN
Resource not opened.
CWBOBJ_RC_SPLFNOTOPEN
Spooled file not open.

Usage

If the handle for the resource was obtained via a call to the cwbOBJ_OpenResourceForSplF() API, then this api will delete the handle for you (the handle was dynamically allocated for you when you opened the resource and this call deallocates it).