Gertjan Klein wrote:
> Yes. However, pywin32 is the one that holds the pointer to the object,
> not Windows COM (at least, I assume this is the case).

Well, only at the most technical level.  The most useful mental model is
to think of the Python object as being the thing that gets passed to the
COM client.  Internally, we know that there has to be a wrapper to
bridge from the incoming C++ virtual function calls into Python method
invocations, but in fact there is a 1-to-1 correspondence between the
COM object wrapper and the Python object it wraps.

> I would have
> figured that it is at pywin32's discretion to delete the object and
> create a new pointer to a new instance.

Technically speaking, yes, that would be possible, but it can't be done
in the general case.  The Python object might contain state information
that the wrapper can't know about, and there's no good way to transfer it.

> (I wish I could somehow pass icons to the
> submenus, but it seems that for that you need completely owner-drawn
> menu items, and that seems like a daunting task!)
>   

Correct.  I decided against that in my own version.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to