[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 SetAt method sets the array element at the specified index.
void SetAt( int nIndex, LPCWSTR newElement );
An integer index that is greater than or equal to zero and less than or equal to the value returned by GetUpperBound.
The object pointer that is inserted in this array. A NULL value is allowed.
This method does not return a value.
The SetAt method does not cause the array to increase. Use SetAtGrow if you want the array to increase automatically.
You must ensure that your index value represents a valid position in the array.
The following code example shows the use of CHStringArray::SetAt.
CHStringArray array; array.Add( L"String 1" ); // Element 0 array.Add( L"String 2" ); // Element 1 array.SetAt( 0, L"String 3" ); // Replace element 0. assert( array == "String 3" );
The following example results in a CHStringArray with two elements.
 = String 3  = String 2
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|
|Header||chstrarr.h (include FwCommon.h)|