[python-win32] Bypassing gen_py, accessing makepy-generated class directly

Jim Bell Jim at JC-Bell.com
Tue Dec 17 01:15:27 CET 2013


I have a somelib.dll/somelib.tlb that doesn't register, and I want to 
bypass the gen_py mechanism to package it better. I run makepy -o 
somelib.py.

I should be able to instantiate it more directly, not through 
client.Dispatch(), shouldn't I? Manually wrap it analogously to the server?

I see somelib.SomeApplication inherits CoClassBaseClass, and that wants
to construct with some sort of object, but what?

# Like this
import somelib
# Not win32com.client.Dispatch(...)
app = somelib.SomeApplication(someMagicHere)
# Above raises 'Class not registered' if passed None.

This thread seemed to be in the ballpark, but I'm still missing something...
https://mail.python.org/pipermail/python-win32/2009-December/009860.html

And I know that, conceptually, something actually needs to reference the 
.dll somewhere, and I don't see that happening. (And that sure seems
like ctypes domain, too.)

Where's my disconnect?



More information about the python-win32 mailing list