Jim:

I have code that looks almost exactly like what you've shown. The "makepy - o" process and the import statement are exactly what I do. I would genericize your class instantiation like this:

app = somelib.SomeServer(serverStartupParameter1, etc)

but, again, it's exactly what I do. I think the problem may be that "SomeServer" in your DLL is not registered as a COM server. You could look at "win32com.server.register" to see how to do that. If it turns out that "SomeServer" is already registered, then you'll have to wait for one of the genuinely smart people on this list to help, because we're at the limit of my understanding here.

- Greg Antal
Gregory W. Antal
Senior Technical Advisor
ATA Engineering, Inc.
11995 El Camino Real, Suite 200	
San Diego, CA  92130
www.ata-e.com

greg.an...@ata-e.com
858-480-2072  (Phone)
858-792-8932  (Fax)
Jim Bell wrote, On 12/16/2013 4:15 PM:
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?

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

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

Reply via email to