Is there a wxMSW equivalent to MFC's COleSafeArray?

Dave Bee davebeeus at yahoo.com
Wed Nov 21 19:41:28 PST 2007


Thank you very much, Vadim.

--- Vadim Zeitlin <vadim at wxwidgets.org> wrote:
> 
>  No, there is no wrapper for SAFEARRAYs in wx but
> you don't need to be an expert in COM to use them,
> there are basically just 4 functions you need to
> use: SysArrayCreate, SysArrayAccess/UnaccessData and
> SysArrayDestroy.
> 

Indeed, after beginning to delve into this, I found
out that COleSafeArray derives from the OLE VARIANT
structure. The OLE SAFEARRAY member functions are
simply made available through COleSafeArray, as well
as a set of member functions specifically designed for
one-dimensional arrays of bytes.

I believe that COleSafeArray::CreateOneDim() is one of
those one-dimensional functions which are not directly
exist in the Win32 API. Interestingly, I see that
wxWidgets dealt with that problem in autmtn.cpp by
calling:

  SafeArrayCreate(VT_VARIANT, 1, &saBound);

in wxConvertVariantToOle().

I will go check now your solution to see if that
really eliminate the need for me to learn the details
of the VARIANT and SAFEARRAY structures.

Dave


      ____________________________________________________________________________________
Be a better pen pal. 
Text or chat with friends inside Yahoo! Mail. See how.  http://overview.mail.yahoo.com/




More information about the wx-users mailing list