Python COM: Automatic wrap/unwrap?

G

Greg Ewing

I'm creating a COM server in Python that will have one
main class, with methods that create and return instances
of other classes.

I've found that I need to use win32com.server.util.wrap
and unwrap on these objects when they pass over a COM
connection. This doesn't seem very convenient, especially
for methods that can be called either via COM or internally
from other Python code.

It seems that the basic Python types are wrapped and
unwrapped automatically when needed. Is there some way of
extending this mechanism? Is there a class I can inherit
from, or a magic attribute I can set, or some registration
process I can use, to get instances of my class automatically
wrapped and unwrapped?
 
L

Larry Bates

Greg said:
I'm creating a COM server in Python that will have one
main class, with methods that create and return instances
of other classes.

I've found that I need to use win32com.server.util.wrap
and unwrap on these objects when they pass over a COM
connection. This doesn't seem very convenient, especially
for methods that can be called either via COM or internally
from other Python code.

It seems that the basic Python types are wrapped and
unwrapped automatically when needed. Is there some way of
extending this mechanism? Is there a class I can inherit
from, or a magic attribute I can set, or some registration
process I can use, to get instances of my class automatically
wrapped and unwrapped?
You should post this on comp.python.windows as Mark and the other Windows/COM
gurus hang around there a lot.

-Larry
 
G

greg

Larry said:
You should post this on comp.python.windows as Mark and the other
Windows/COM gurus hang around there a lot.

I can't find any such newsgroup -- are you sure
that's what it's called?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top