contents   index   previous   next



SafeArraySetElementSize

 

f90VB Modules

 

f90VBDefs, f90VBSafeArrays

Summary

 

Sets the size (in bytes) of the elements of an array.

Syntax

 

subroutine SafeArraySetElementSize (SARef, ElmSize, iRet)

{
integer(SAFEARRAY_KIND),intent(in):: SARef |
type(FSafeArray),intent(in):: SARef |
}
integer(LONG_KIND),intent(in):: ElmSize
integer(HRESULT_KIND),intent(out),optional:: iRet

Arguments

 

SARef [Input]

A handle to, or a Fortran Safe Array structure containing a handle to, an allocated Safe Array descriptor.

 

ElmSize [Input]

Size in bytes of the element of the array.

 

iRet [Output, Optional]

Upon return, iRet contains S_OK or an error code. See comments for more information.

Comments

 

Note that SARef must be a reference to an allocated Safe Array descriptor. This function is typically called after a call to SafeArrayAllocDescriptor and before calling SafeArrayAllocData.

 

You should never call SafeArraySetElementSize on a Safe Array for which data has already been allocated. This includes any Safe Array created with SafeArrayCreate.

Argument iRet

 

Indicates success or failure of the subroutine. The following codes can be returned in this argument:

 

 

Value returned in argument iRet Description
S_OK Success.
DISP_E_ARRAYISLOCKED The array is currently locked.
E_INVALIDARG The item pointed to by SARef is not a Safe Array descriptor

Examples

 

See Example 2.4 (User Manual - Chapter 2).

Related Topics

 

For information about See
Obtaining the size of the elements of a Safe Array SafeArrayGetElementSize, SafeArrayElementSize
Creating a Safe Array SafeArrayCreate
Allocating Safe Array data SafeArrayAllocData
Allocating a Safe Array descriptor SafeArrayAllocDescriptor

 


SafeArraySetFeatures