--- In [email protected], "brucexs" <bruc...@...> wrote:
>
> > In new code in COM code handling SAFEARRAYS, there's a possibility of a vec 
> > element getting assigned to a newly created handle to a com object.  
> 
> You should be calling changerefhandle here on the vec, in case someone ever 
> implements a version of the vec plugin that uses reference counting.  It's 
> probably less than 20 lines of code to do that, but not planning it for now, 
> but who knows about the future.

Um, maybe not?  Since my code would go

  pVecServices->create_vet(....,pszNewVecHanBuff);
//got new vec now
//later; put a com handle in iNdx'th eelement of vector
  pVecServices->set_vec(pszNewVecHanBuff, iNdx, 
           pszNewCommHanBuff);

In this case I can absolutely guarantee that vector element iNdx had nothing in 
it before I called pVecServices->set_vec, since vec is clean shiny new.  If I 
understand ppsv->changerefhandle, now no chance I'm overwritting something that 
needed ref counting.



Reply via email to