CHStringArray::Add method (chstrarr.h)

[The CHStringArray class is part of the WMI Provider Framework which is now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development.]

The Add method adds a new element to the end of an array, increasing the array by one.

Syntax

int  throw(CHeap_Exception) Add(
  LPCWSTR newElement
);

Parameters

newElement

The element to be added to the array.

Return value

If the Add method is successful, it returns the index of the added element.

Remarks

If SetSize has been used with an nGrowBy value greater than 1, then extra memory can be allocated. However, the upper bound increases by only one.

Examples

The following code example shows the use of Add.

    CHStringArray array;
    CHString s( L"String 2");
    
    array.Add( L"String 1" ); // Element 0
    array.Add( s );           // Element 1

Requirements

   
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header chstrarr.h (include FwCommon.h)
Library FrameDyn.lib
DLL FrameDynOS.dll; FrameDyn.dll

See also

CHStringArray

CHStringArray::Append

CHStringArray::Copy