Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method changes the size of the byte array.

Syntax

HRESULT SetSize( 
  ULARGE_INTEGER 
cb 
);

Parameters

cb

[in] New size of the byte array as a number of bytes.

Return Value

The following table shows the return values for this method.

Value Description

S_OK

The size of the byte array was successfully changed.

STG_E_ACCESSDENIED

The caller does not have permission to access the byte array.

STG_E_MEDIUMFULL

The byte array size is not changed because there is no space left on the storage device.

Remarks

ILockBytes::SetSizechanges the size of the byte array.

If the cbparameter is larger than the current byte array, the byte array is extended to the indicated size by filling the intervening space with bytes of undefined value, as does the ILockBytes::WriteAtmethod, if the seek pointer is past the current end-of-stream.

If the cbparameter is smaller than the current byte array, the byte array is truncated to the indicated size.

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Notes to Callers

Callers cannot rely on STG_E_MEDIUMFULL being returned at the appropriate time because of cache buffering in the operating system or network. However, callers must be able to deal with this return code because some ILockBytesinterface implementations might support it.

Requirements

Header objidl.h, objidl.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later