未分类--Windows API--SafeArrayDestroy

来源:互联网 发布:行之愈笃 则知之益明 编辑:程序博客网 时间:2024/06/07 21:11

原文来自MSDN Library for Visual Studio 2008 SP1,翻译部分仅为个人观点,想要看更多信息请看MSDN,如有版权问题请联系QQ 643166601,邮件643166601@qq.com

Platform Builder for Microsoft Windows CE 5.0   

SafeArrayDestroy

This function destroys an array descriptor and all data in the array.
这个函数销毁一个数组描述符和数组中的所有数据。
If objects are stored in the array, Release is called on each object in the array.
如果在数组中存放的是对象,调用数组中的每个对象的Release。
HRESULT SafeArrayDestroy(
  SAFEARRAY FAR* psa
);
Parameters
psa
[in] Pointer to an array descriptor created by SafeArrayCreate.
指针指向由SafeArrayCreate创建的一个数组描述符。
Return Values
Returns the HRESULT values shown in the following table.
返回HRESULT值展示在下表。
Value Description
S_OK
Success.
成功。
DISP_E_ARRAYISLOCKED
The array is currently locked.
这个数组当前被锁定。
E_INVALIDARG
The item pointed to by psa is not a safearray descriptor.
psa指向的项不是一个安全描述符。
Remarks
Passing invalid (and under some circumstances NULL) pointers to this function causes an unexpected termination of the application.
传入无效的(在某些情况下NULL)指针到这个函数引起意外的程序终止。
Example
STDMETHODIMP_(ULONG) CEnumPoint::Release()
{
  if(--m_refs == 0){
    if(m_psa != NULL)
    SafeArrayDestroy(m_psa);
    delete this;
    return 0;
  }
  return m_refs;
}
Requirements
OS Versions: Windows CE 2.0 and later.
Header: Oleauto.h.
Link Library: Oleaut32.lib.

See Also
Automation Functions | SafeArrayCreate

 


--------------------------------------------------------------------------------

Last updated on Wednesday, September 14, 2005

© 2005 Microsoft Corporation. All rights reserved.

 

 

0 0