cwbCO_SetUserIDEx

Purpose

This function sets the user ID to associate with the specified system object. This user ID will be used when connecting to the iSeries™ server with either the cwbCO_Signon or cwbCO_Connect call.

Syntax

 
UINT CWB_ENTRY cwbCO_SetUserIDEx(
                              cwbCO_SysHandle    system,
                              LPCSTR             userID );

Parameters

cwbCO_SysHandle system - input
Handle that previously was returned from cwbCO_CreateSystem or cwbCO_CreateSystemLike. It identifies the iSeries server system.
LPCSTR userID - input
Pointer to a buffer that contains the NULL-terminated user ID. The user ID must not be longer than CWBCO_MAX_USER_ID characters, not including the terminating NULL character.

Return Codes

The following list shows common return values.

CWB_OK
Successful completion.
CWB_INVALID_API_HANDLE
Invalid system handle.
CWB_INVALID_POINTER
The userID pointer is NULL.
CWB_NON_REPRESENTABLE_UNICODE_CHAR
One or more input Unicode characters have no representation in the codepage that is being used.
CWB_INV_AFTER_SIGNON
Signon successfully has occurred by using the specified system object, so this setting no longer may be changed.

Usage

This API cannot be used after a successful signon has occurred for the specified system object. A signon has occurred if either cwbCO_Signon or cwbCO_Connect has been called successfully for this system object. Setting a user ID explicitly with this API will cause any default user mode set with the cwbCO_SetDefaultUserMode API to be ignored.