[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 SetSize method establishes the size of an empty or existing array.
void throw(CHeap_Exception) SetSize( int nNewSize, int nGrowBy );
The new array size (number of elements). The value must be greater than or equal to 0 (zero).
The minimum number of element slots to allocate if a size increase is necessary.
This method does not return a value.
The SetSize method allocates memory if necessary. If the new size is smaller than the old size, then the array is truncated, and all unused memory is released. For efficiency, call SetSize to set the size of the array before using it. This prevents the need to reallocate and copy the array each time an item is added.
See the example for CHStringArray::GetData.
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|
|Header||chstrarr.h (include FwCommon.h)|