Is DDE support fully available in win32all-108? : ->
I've just downloaded Win32all-108 (beta version) of the new
PythonWin and extensions. Looking at the imports from
import dde I notice that I might be able to create a DDE
server in Python. What I am doing looks like this:
from dde import *
ddeServer = CreateServer()
ddeTopic = CreateTopic("Reservation")
ddeStringItem = CreateStringItem("Pnr")
ddeTopic.AddItem(ddeStringItem)
ddeServer.Create('Res_Server')
At this point I get following error message:
'Error: the server could not be created'
typing 'ddeServer.GetLastError()' returns 16387
Varying the order of the calls does not change
anything. Testing for the GetLastError on the
call ddeServer = CreateServer()
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
If COM is an acceptable alternative, then win32all definitely supports it
:-)
(DDE is generally deprecated, I believe)
--
Greg Stein (gst...@lyra.org)
No, this is a wish which I share, but it is very alive, due to
Netscape. If you want to control Netscape locally, and you don't
have a HTTP server and want to communicate with it without doing
everything through plugins and applets, you have to use DDE.
A DDE client is needed to push Netscape to show an URL in some
window. I got this to work with a modified version of Sam's windde
module.
For the opposite way: Netscape requesting pages from your Python app,
it is necessary to become a DDE server and to register a new protocol.
This is my current problem. I looked into the win32 source code.
DDE is supported complete internally, but just a few methods are
exposed to Python. Especially DDE-Request and DDE-Poke are missing.
This all is not needed for MSIE since it ahs a very complete COM
interface. But my testing showed the good news: Both NS and MSIE
support the DDE implementation of the NSAPI, so I am sure it is
possible to write a local HTTP surrogate with this.
The result of this would be:
Applications can make use of "any" (MSIE, NS, Opera,...) browser
as a GUI, regardless wether the server process is a true server
(using http) or a local process (using the surrogate).
This is where I'm hacking on for my current project.
cheers - pirx
--
Christian Tismer :^) <mailto:tis...@appliedbiometrics.com>
Applied Biometrics GmbH : Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101 : *Starship* http://starship.skyport.net
10553 Berlin : PGP key -> http://pgp.ai.mit.edu/
we're tired of banana software - shipped green, ripens at home
It may seem that this is partly "deprecated" technology but the
truth is that DDE is pretty robust and is generally simpler
thank a lot of other interfaces.
I could write the software in Visual Basic but I'd much prefer
doing it in CPython on the PC side. The AS/400 does not have
a C compiler so I can forget writing the socket server in
It may seem that this is partly "deprecated" technology but the
truth is that DDE is pretty robust and is generally simpler
thank a lot of other interfaces.
I could write the software in Visual Basic but I'd much prefer
doing it in CPython on the PC side. The AS/400 does not have
a C compiler so I can forget writing the socket server in C
as an AS/400 C compil
It may seem that this is partly "deprecated" technology but the
truth is that DDE is pretty robust and is generally simpler
thank a lot of other interfaces.
I could write the software in Visual Basic but I'd much prefer
doing it in CPython on the PC side. The AS/400 does not have
a C compiler so I can forget writing the socket server in C
as an AS/400 C compiler license costs ca. $15,000!
My plan on the AS/400 side is installing IBM's java toolkit
and trying to then load the JPython core onto it. Now that
would be fun 8-)
Anyway-> I've got a server model going under CPython
(just haven't figured out how to handle callbacks from it)
as I'd like my CPython DDE server to handle "wild requests"
i.e. I don't want to register my DDE Service by name but
want to be explicitly called by Topic.
Any help handling DDE using CPython would be greatly
appreciated!!!
--
Florent Heyworth
Yes it is. Pythonwin now uses it so that if you right-click on a .py file
and select "Edit", and existing Pythonwin will open the file. Further, you
can use DDE to get Pythonwin to execute arbitary Python code - the DDE
string sent is actually just arbitary code executed by the running Pythonwin
(what do you mean "security"? :-)
But Im afraid Im not experienced enought with DDE to answer your questions.
All I know is that the Pythonwin support lives in "intpydde.py", and that
works fine :-)
Mark.
[yes DDE is more alive than we like]
> I could write the software in Visual Basic but I'd much prefer
> doing it in CPython on the PC side. The AS/400 does not have
> a C compiler so I can forget writing the socket server in
Do you need a client, server, or both? To what extent?
If you are fine with dde_execute and dde_request, I can help you.
WIth the server part, I'm in the very beginning.
> Server:
> - server receives all DDE requests sent to a particular service/topic
>
> Client:
> - client deals with dde_execute and dde_request
>
> On the server side I coded the following test code in the Python
> interpreter:
> import win32ui
> import dde
>
> server = dde.CreateServer()
> server.AddTopic(dde.CreateServerSystemTopic())
> server.AddTopic(dde.CreateTopic('RunAnyCommand'))
> server.Create('RunAny')
this already breaks for me. "error: The server could not be created"
must "RunAny" be define somewhere else?
> On the client side I can write:
> import windde
> client = windde.dde_session()
> client.initialize()
> client.connect('','RunAnyCommand')
>
> and that works fine. My problem is I'm not sure where to take it from there.
>
> I've got to worry deal with callbacks and finding out when the server has
> been connected to. I can't seem to get the execute statement to work.
At least I can tell you about the client side.
In windll, add the following to the class dde_session:
def request (self, command):
htext = dde_string(self, command)
result = windll.membuf(4)
retval = user32.DdeClientTransaction (
0, # pData
0x0, # cbData
self.conversation, # hConv
htext, # hszItem
CF_TEXT, # wFmt
XTYP_REQUEST, # wType
10000, # dwTimeout
result # pdwResult
)
if not retval:
self.hurl ('DdeClientTransaction')
else:
return struct.unpack ('l', result.read())[0]
Then you have at least a way to control Nestcape which relies on
dde_request:
>>> import dynwin
>>> import windde2 # with the above addition
>>> s=windde2.dde_session()
>>> s.initialize()
>>> s.connect("NETSCAPE", "WWW_OpenURL")
>>> s.request("http://starship.skyport.net")
1953785890
>>>
This takes my browser where it should.
For more, we have to work on the callback function. As you can see,
Sam already prepared a dummy callback func in windde.
I think with some more hours of trying, this could work as well.
cheers - chris
> [...]
>
> [yes DDE is more alive than we like]
>
> > I could write the software in Visual Basic but I'd much prefer
> > doing it in CPython on the PC side. The AS/400 does not have
> > a C compiler so I can forget writing the socket server in
>
> Do you need a client, server, or both? To what extent?
> If you are fine with dde_execute and dde_request, I can help you.
> WIth the server part, I'm in the very beginning.
Hi
what I actually need is a DDE client/server application. It would basically
work like
this:
Server:
- server receives all DDE requests sent to a particular service/topic
Client:
- client deals with dde_execute and dde_request
On the server side I coded the following test code in the Python
interpreter:
import win32ui
import dde
server = dde.CreateServer()
server.AddTopic(dde.CreateServerSystemTopic())
server.AddTopic(dde.CreateTopic('RunAnyCommand')
server.Create('RunAny')
On the client side I can write:
import windde
client = windde.dde_session()
client.initialize()
client.connect('','RunAnyCommand')
and that works fine. My problem is I'm not sure where to take it from there.
I've got to worry deal with callbacks and finding out when the server has
been connected to. I can't seem to get the execute statement to work.
Any help concerning either the client or the server part would be greatly
appreciated 8-)
Florent Heyworth
> Who by? MS deprecates anything that already works for fairly obvious
> commercial reasons. DDE works for several huge financial data distribution
> programs and is a lowest common denominator. It's much easier to understand
> and has a smaller footprint than the more experimental
> alternatives. Commercial interests will keep the bleeding edge sharp as long
> as masochists are willing to cut themselves. Concentrate on robustness not
> cuteness. End ramble. -- Robin Becker
I personally like "portable" solution. That is, in this case, somebody could
make a module which is an Interface to the COM module *and* the DDE modules.
So, everybody is satisfied.
As I already mentioned, the same counts especially for application GUIs which
don't necessarely needs graphics. Supporting ncurses and Tk (if you'd like to
also KDE, GTK and Motif) should satisfy everyone, though I haven't made a
module for supporting all those GUI Interfaces. I simply make my programs so,
that the GUI is (mostly) a more or less separated part of the program and make
different versions for different Interfaces for it.
--
Julien Oster <sys...@sysadm.cc>
.+'''+. .+'''+. .+'''+.
---+-------+-------+-------+-------+-------+---
.' `+.,.+' '+.,.+' '.
I agree completely with Robin. DDE should be the method of choice for what
its name implies, Data Exchange. There is no way Microsoft can stop
supporting it. See the web site for a tool that could help you.
Roger Abbott
RHA (Minisystems) Ltd.
http://www.angelfire.com/biz/rhaminisys