contents   index   previous   next



SafeArrayGetElementPtr

 

f90VB Modules

 

f90VBDefs, f90VBSafeArrays

Summary

 

Returns the memory address of a Safe Array element. The array should be locked before this function is called.

Syntax

 

integer(LONG_KIND) function SafeArrayGetElement (SARef, IdxVector, iRet)

{
Integer(SAFEARRAY_KIND),intent(in):: SARef |
type(FSafeArray),intent(in):: SARef |
}
integer(LONG_KIND),dimension(:),intent(in):: IdxVector
integer(HRESULT_KIND),intent(out):: iRet

Arguments

 

SARef [Input]

A handle to, or a Fortran Safe Array structure containing a handle to, an allocated Safe Array that has been locked.

 

IdxVector [Input]

A vector with the indexes (coordinates) of the Safe Array element whose memory address is to be retrieved. See comments for more information.

 

iRet [Output]

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

Comments

 

The passed Safe Array must be locked before this function is called, failing to do so will produce an unpredictable result.

Argument IdxVector

 

The size of Idx must be at least equal to the number of dimensions of the Safe Array. The indexes of the vector correspond to dimensions of the array (i.e. first entry in Idx contains the coordinate for the first dimension, the second entry contains the coordinate for the second dimension, and so on).

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_BADINDEX The specified index was invalid.
E_INVALIDARG One of the arguments is invalid.

Related Topics

 

For information about See
Obtaining the value of a Safe Array element SafeArrayGetElement
Changing the value of a Safe Array element SafeArrayPutElement
Accessing data in a Safe Array using a mapped Fortran array SafeArrayAccessData

 


f90VBVariants Library