SafeArrayLock

HRESULT SafeArrayLock( 
  SAFEARRAY FAR*  psa  
);
 

Increments the lock count of an array, and places a pointer to the array data in pvData of the array descriptor.

Parameter

psa
Pointer to an array descriptor created by SafeArrayCreate.

Return Value

The return value obtained from the returned HRESULT is one of the following.

Return value Meaning
S_OK Success.
E_INVALIDARG The argument psa was not a valid safe array descriptor.
E_UNEXPECTED The array could not be locked.

Comments

The pointer in the array descriptor is valid until SafeArrayUnlock is called. Calls to SafeArrayLock can be nested. An equal number of calls to SafeArrayUnlock are required.

An array cannot be deleted while it is locked.

QuickInfo

  Windows NT: Use version 3.1 and later.
  Windows: Use Windows 95 and later.
  Header: Declared in oleauto.h.
  Import Library: Link with oleaut32.lib.