ILockBytes::SetSize

Changes the size of the byte array.

HRESULT SetSize(

ULARGE_INTEGER cb
//Specifies the new size of the byte array in bytes
);

Parameter

cb

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

Return Values

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.

Comments

This method changes the size of the byte array. If the cb parameter 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. This operation is similar to the ILockBytes::WriteAt method if the seek pointer is past the current end-of-stream.

If the cb parameter is smaller than the current byte array, then the byte array is truncated to the indicated size.

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 ILockBytes implementations might support it.

See Also

ILockBytes::ReadAt, ILockBytes::WriteAt

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database