COM Client / Server creation?

D

Dan

New to python. Running under windows xp. Need help getting started
writing COM server and client. Want to basically have two interfaces on
the server, register() and fire_event1(). register registers a client
to receive the fire_event1() event. The client will then need an event
handler implemented to receive the events. Each new client that calls
register should be tracked in the server so that all of the clients
receive the event. I have done this very easiliy with traditional
programming languages but don't reall know where to start here. Dan
 
D

Dan

Ive got the chapter from the net on COM. It looks pretty old, 2000.
Also the very first example in the chapter on COM doesn't seem to work.
Is what I am wanting to do possible with Python?
 
J

John J. Lee

Dan said:
Ive got the chapter from the net on COM. It looks pretty old, 2000.
Also the very first example in the chapter on COM doesn't seem to work.
Is what I am wanting to do possible with Python?

As long as you're doing IDispatch, essentially anything is possible
with pywin32's COM support.

What went wrong with the first example in the book?

Not covered in the book, and particularly useful for implementing
native clients and servers is ctypes / comtypes (but still not stable;
also, I've only personally used it for writing a client, and a very
simple one at that):

http://starship.python.net/crew/theller/ctypes/com.html


John
 
D

Dan

What went wrong...
Operator Error. My appologies. If typed in correctly the example works
perfectly. I was using the PythonWin shell and when I started to type
in it suggested CDispatch and I typed that in. I will be looking to
pick up a copy of the book if I continue to use Python. I still do not
know if it will be sufficient to my purposes. It looks like a very
powerful scripting language. Dan
 
J

John J. Lee

Not covered in the book, and particularly useful for implementing
native clients and servers is ctypes / comtypes (but still not stable;
also, I've only personally used it for writing a client, and a very
simple one at that):

http://starship.python.net/crew/theller/ctypes/com.html

Just to clarify this: ctypes IS stable, and in fact will be part of
Python 2.5 (first alpha to be released in a week or so). comtypes is
the "work-in-progress" (though it has been quite useable, at least for
the simple stuff I did, for some time now). It's all quite elegant,
too.


John
 

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

Forum statistics

Threads
474,291
Messages
2,571,453
Members
48,134
Latest member
JavierIlif

Latest Threads

Top