SafeArrayDestroy
This function destroys an existing array descriptor and all of the data in the array. If objects are stored in the array, Release is called on each object in the array.
HRESULT SafeArrayDestroy(
SAFEARRAY FAR *psa );
Parameters
- psa
Pointer to an array descriptor created by SafeArrayCreate.
Return Values
One of the values obtained from the returned HRESULT and described in the following table is returned.
| Value | Description |
|---|---|
| S_OK | Success. |
| DISP_E_ARRAYISLOCKED | The array is currently locked. |
| E_INVALIDARG | The item pointed to by psa is not a safe array descriptor. |
Remarks
Passing into this function any invalid and, under some circumstances, NULL pointers will result in unexpected termination of the application.
Example
STDMETHODIMP_(ULONG) CEnumPoint::Release()
{
if(--m_refs == 0){
if(m_psa != NULL)
SafeArrayDestroy(m_psa);
delete this;
return 0;
}
return m_refs;
}
Requirements
| Runs on | Versions | Defined in | Include | Link to |
|---|---|---|---|---|
| Windows CE OS | 2.0 and later | Oleauto.h | Oleaut32.lib |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
Last updated on Tuesday, July 13, 2004
© 1992-2000 Microsoft Corporation. All rights reserved.