[Twisted-Python] Is it possible to build a .dll for other win32 program/language to invoke?
Hi all! This question may not be suitable to ask here, but please help me if you can, thanks! I have written a server with twisted. The server contains some classes which are responsible for handling protocol related stuffs (e.g. packing/unpacking messages). We've already has an app which was written in delphi, we want to extend it to be able to communicate with this server. Here comes the question: is it possible to build the protocol related classes from the server to be some kind of .dll, so that the app could invoke them, reuse them to handle the protocol related stuffs? Any infomation would be warmly welcome, thanks in advance! - Eric
On Jul 14, 2005, at 4:37 PM, Eric Hsu wrote:
This question may not be suitable to ask here, but please help me if you can, thanks!
I have written a server with twisted. The server contains some classes which are responsible for handling protocol related stuffs (e.g. packing/unpacking messages).
We've already has an app which was written in delphi, we want to extend it to be able to communicate with this server.
Here comes the question: is it possible to build the protocol related classes from the server to be some kind of .dll, so that the app could invoke them, reuse them to handle the protocol related stuffs?
Any infomation would be warmly welcome, thanks in advance!
The best way to do this is probably "server-side" COM. See win32all and ctypes, doesn't really have much of anything to do with Twisted at that point. -bob
On Fri, Jul 15, 2005 at 10:37:04AM +0800, Eric Hsu wrote: [...]
Here comes the question: is it possible to build the protocol related classes from the server to be some kind of .dll, so that the app could invoke them, reuse them to handle the protocol related stuffs?
Any infomation would be warmly welcome, thanks in advance!
On Windows, you could probably achieve this with the pythoncom facilities of Mark Hammond's win32all package. Delphi apparently works quite well with COM. I haven't touched Windows for quite a while though, so I can't really help with the details of doing that. -Andrew.
It's just a guess, but i would think you could write a wrapper for this
with swig (www.swig.org) or boost
(http://www.boost.org/libs/python/doc/index.html)
greets, Sebastian
2005/7/15, Andrew Bennetts
On Fri, Jul 15, 2005 at 10:37:04AM +0800, Eric Hsu wrote: [...]
Here comes the question: is it possible to build the protocol related classes from the server to be some kind of .dll, so that the app could invoke them, reuse them to handle the protocol related stuffs?
Any infomation would be warmly welcome, thanks in advance!
On Windows, you could probably achieve this with the pythoncom facilities of Mark Hammond's win32all package. Delphi apparently works quite well with COM.
I haven't touched Windows for quite a while though, so I can't really help with the details of doing that.
-Andrew.
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Eric Hsu wrote:
Here comes the question: is it possible to build the protocol related classes from the server to be some kind of .dll, so that the app could invoke them, reuse them to handle the protocol related stuffs?
An alternative approach might be to expose your server's functionality via xmlrpc. Not sure what writing xmlrpc clients in delphi is like; but it might be more pleasant than trying to generate dlls and makes other things possible. good luck :) Andy.
Big thanks to Bob, Andrew, Sabastian and Andy! I found the server-side com would be helpful to us: wrap the python code to be a server-side com, and let other win32 programs to invoke it. It's very kind of you providing me so much helpful informations, thank you all guys :D Best regards! - Eric
participants (5)
-
Andrew Bennetts
-
Andy Gayton
-
Bob Ippolito
-
Eric Hsu
-
Sebastian Schulze