How does one return a local CComSafeArray to a LPSAFEARRAY output parameter?

后端 未结 3 2208
花落未央
花落未央 2021-02-20 05:35

I have a COM function that should return a SafeArray via a LPSAFEARRAY* out parameter. The function creates the SafeArray using ATL\'s CComSafeArray te

3条回答
  •  梦如初夏
    2021-02-20 06:05

    I'd guess that where was no intent to allow such a use case. Probably it was not the same developer who wrote CComVariant & CComPtr :)

    I believe that CComSafeArray's author considered value semantics as major goal; Attach/Detach might simply be a "bonus" feature.

提交回复
热议问题