[python-win32] cleaning up after DDE client requests
Jim McLoughlin
jimmcloughlin at earthlink.net
Thu Apr 28 21:11:48 CEST 2005
Hi
I have successfully used the DDE apis as a client to some DDE data
services (normally accessed by excel). These services have a limit on
the number of simultaneous DDE requests I can make (~300 at one time) -
but this should not be a problem, as I make all of these requests
sequentially.
For a small number of requests, things are fine. However, a sequence
of 1000 requests seems to run into problems. So my question is: is
there some clean up code that can be used for conversations, servers,
etc? Can I do something like conversation.terminate() or
server.destroy() to make sure I am cleaning things up properly?
An unrelated question: If I am only acting as a DDE client, why do I
need to instantiate a server - is it behaving as a proxy to the
(non-python) DDE server process that already exists on my machine?
Thanks for any help.
JM
E.g. code I am using:
import win32ui
import dde
function getDataViaDDE(myRequests)
server = dde.CreateServer()
server.Create('MyDataProxy')
conversation = dde.CreateConversation(server)
conversation.ConnectTo("DDEServiceName", "DataTopic")
myResults = {}
for request in myRequests
myResults[request] = conversation.Request(request)
return myResults
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1301 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-win32/attachments/20050428/4160c2b5/attachment.bin
More information about the Python-win32
mailing list