SetHandleCount

3.0

  UINT SetHandleCount(cHandles)    
  UINT cHandles; /* number of file handles needed */

The SetHandleCount function changes the number of file handles available to a task.

Parameters

cHandles

Specifies the number of file handles the application requires. This count cannot be greater than 255.

Return Value

The return value is the number of file handles available to the application, if the function is successful. This number may be less than the number of handles specified.

Comments

By default, the maximum number of file handles available to a task is 20.

Example

The following example uses the SetHandleCount function to set the number of available file handles to 30:

UINT cHandles;
char szBuf[80];

cHandles = SetHandleCount(30);

sprintf(szBuf, "%d handles available", cHandles);
MessageBox(hwnd, szBuf, "SetHandleCount", MB_OK);