[Python Win32] Accessing Python COM objects

"Charles Krug" at cdksystems.com "Charles Krug" at cdksystems.com
Thu Mar 18 17:34:49 CET 2004

Hello Bruces:

I've created a logging class. The interface from Python's PoV works
like this:

X = myLogger() # Creates an instance
X("some user", "some process", "A message to be logged")

Works a champ.

I'd like to be able to use identical semantics from VB.  However,
it VB seems not to recognize the syntax.

I've created a COM class that has-a myLogger instance.
I've exposed the __call__ method in _public_methods_

But vb cannot access the COM log object via its instance name the
way that Python can.

As a check, I added a public logEntry() method to the COM class.

I've verified that all the features of the COM class work correctly,
EXCEPT "call by name" (which I expect to invoke the __call__ method.)

Is there some way to convince VB to allow this?

I'm referring to "Python Programming on Win32" 1st Ed.

Is this simply not possible?  It's not a "problem" so much as a


Charles Krug

More information about the Python-list mailing list