--- In [email protected], "brucexs" <bruc...@...> wrote:
> > obj = "" > I should have mentioned that this will work now out of the box, assuming obj > hold the only reference to a com object. Yeah, understood. Nice feature. > The variable assignment stuff in PowerPro gets used (since "" is not a > handle), but it calls changerefhandle, which sees that obj has a release call > back, and so that will get called. You can then free the object. > I also wanted to draw attention to the fact that you should create new > objects with a reference count of zero in case they are never assigned. It > is when they are assigned that you get called to increment ref count. Or if > they are just temps that are not assigned, you get refcallback(...,0) to > delete them. Understood, and that's what I'm doing. One more question: Normally when I create a new handle I also return it, and therefore I also call ppsv->ReturningNewHandle. 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. I also return the handle to the newly created vec (so com plugin service is returning a vec handle). Is it appropriate to call ppsv->ReturningNewHandle in that case? My guess is it's not appropriate to call it in
