cwbOBJ_RefreshObj

Purpose

Refreshes the object with the latest information from the iSeries™ server. This will ensure the attributes returned for the object are up to date.

Syntax

 
unsigned int CWB_ENTRY cwbOBJ_RefreshObj(
                              cwbOBJ_ObjHandle  objectHandle,
                              cwbSV_ErrHandle   errorHandle);

Parameters

cwbOBJ_ObjHandle objectHandle - input
Handle of the object to be refreshed.
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 an allocated object handle.
CWBOBJ_RC_HOST_ERROR
Host error occurred. Text may be in errorHandle.

Usage

The following object types may be refreshed:

Example: Assume listHandle points to a spooled file list with at least one entry in it.
cwbOBJ_ObjHandle splFileHandle;
ulRC = cwbOBJ_GetObjHandle(listHandle,
0,
&splFileHandle,
NULL);
if (ulRC == CWB_NO_ERROR)
{
  ulRC = cwbOBJ_RefreshObj(splFileHandle);
  .....
  get attributes for object
  .....
  ulRC = cwbOBJ_DeleteObjHandle(splFileHandle);
}