StrArray COM and API helpers

Web Site  Methods

 

StrArray::ToSafeArray

 
SAFEARRAY* ToSafeArray (VARTYPE destVtType,
               int startIndex = 0, int nCount = -1)

This method will construct a new SAFEARRAY with the COM API.  The safe array can contain a subset, or all of the elements in the StrArray. The safe array is always constructed as one-dimensional, with a lower bound of zero, and contains the array strings formatted as either BSTR values, or VARIANTs containing a VT_BSTR value.

The returned SAFEARRAY is resizeable and can be further manipulated with COM functions, passed to other objects and so on.  To dispose the SAFEARRAY and all associated memory, call the SafeArrayDestroy Windows API function.

 

See alsoStrArray class