[python-win32] "Casting" COM objects

Paul Prescod paul@prescod.net
Thu, 03 Apr 2003 14:49:58 -0800


Jens B. Jorgensen wrote:
> ...
> 
> It is inconvenient, I know. It is no wonder more recent models such as 
> Java and CLR support a "reflection" interface to discover type 
> information about an object pointer eh?

I didn't know that COM lacked that. Thanks for the info.

Still, there is at least enough reflection in there to support dispatch 
interfaces. Would it be feasible for the classes generated by MakePy to 
"try" a method call or property assignment even if it wasn't known at 
compile time? Is the underlying object used in a dynamic dispatch 
interface versus a Makepy interface basically the same object? If so, 
the Makepy classes could try the dynamic approach before giving up and 
throwing an exception...

  Paul Prescod