SafeArray--Windows API--SafeArrayGetLBound

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

 

Platform Builder for Microsoft Windows CE 5.0   

SafeArrayGetLBound

This function retrieves the lower bound for any dimension of a safearray.
这个函数取回任何一个safearray维数的下界。
HRESULT SafeArrayGetLBound(
  SAFEARRAY FAR* psa,
  unsigned int nDim,
  long FAR* plLbound
);
Parameters
psa
[in] Pointer to an array descriptor created by SafeArrayCreate.
指针指向一个由SafeArrayCreate创建的一个数组描述符。
nDim
[in] Specifies the array dimension to get the lower bound for.
指定数组维数去获得下界。
plLbound
[out] Pointer to the location to return the lower bound.
指针指向的位置去返回下界。
Return Values
Returns the HRESULT values shown in the following table.
返回的HRESULT值展示在下表。
Value Description
S_OK
Success.
成功。
DISP_E_BADINDEX
The specified index is out of bounds.
指定的索引超出范围。
E_INVALIDARG
An argument is invalid. 
一个无效的说法。
Remarks
Passing invalid (and under some circumstances NULL) pointers to this function causes an unexpected termination of the application.
传入无效的(在某些情况下NULL)指针到这个函数引起意外的程序终止。
Example
HRESULT
CEnumPoint::Create(SAFEARRAY FAR* psa, CEnumPoint FAR* FAR* ppenum)
{
  long lBound;
  HRESULT hresult;
  CEnumPoint FAR* penum;

  // Verify that the SafeArray is the proper shape.
  HRESULT = SafeArrayGetLBound(psa, 1, &lBound);
  if(FAILED(hresult))
    return hresult;

  // Code omitted here for brevity.

}
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.

 

你可能感兴趣的:(windows,api)