title: COleSafeArray vs CComSafeArray
body: <p>I am in a situation where I have a COM object that I need to use in come windows only C++ code. The COM object has functions that accept SAFEARRAYs as arguments to pass arrays of bytes. After looking at the SAFEARRAY API ( <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms221145(v=vs.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/ms221145(v=vs.85).aspx</a> ) I decided it wasn't what I wanted  and that I should find an object oriented wrapper. I tried looking for open source ones and I didn't find any. I found that microsoft has created two objects that seem to encapsulate SAFEARRAY. It looks like the CComSafeArray is exactly what I need, and like the the COleSafeArray might be useful but could exist only for legacy compatibility.</p>
  
  <p>Is COleSafeArray just around for historical compatibility or is there something I am missing? </p>
  
  <p>When should COleSafeArray be used instead of CComSafeArray?</p>
  
  <p>Are there any open source implementations that might be worth looking into?</p>
  
  <p>What are the Pros and Cons of each?</p>