Python kernel32 exception on Win9x while using DDE extensions
Patrick Vrijlandt
p.vrijlandt at aig.azn.nl
Mon Nov 19 08:09:37 EST 2001
When I asked this question before, MH answered that the dos-window
(command-line) has no concept of messages like a normal windows app; so you
can't use dde from a dos-window.
"Nic" <nicbar at mail.com> schreef in bericht
news:b2b5c45f.0111122345.3f5ed40d at posting.google.com...
> "Patrick Vrijlandt" <p.vrijlandt at aig.azn.nl> wrote in message
news:<9s85bf$5qd$1 at odysseus.uci.kun.nl>...
> > > I am running on Win98 SE with the latest DCOM installed.
> > > When I try to run the following script fragment from python.exe or
> > > pythonw.exe I get a “page fault exception” in
> > > kernel32.dll
> > >
> > > import win32ui
> > > import dde
> > > import sys
> > >
> > > def send_string(str):
> > > # …..
> > > pass
> > >
> > > print "Starting DDE v1.02"
> > > cESC = chr(27)
> > > cF11 = cESC + '[23~'
> > >
> > > server = dde.CreateServer()
> > >
> > > # The problem is in the following line
> > > server.Create("ERTestClient")
> >
> > should be:
> > server.Create('')
> >
> > > conv = dde.CreateConversation(server)
> >
> > then:
> > conv.ConnectTo("ERTestClient", service) # service might be "System"
> >
> > >
> > > while 1:
> > > str = raw_input("Enter String: ")
> > > if str == "EXIT": break
> > > str_all = cF11 + str
> > > ## send_string(str_all)
> > >
> > > print "DONE"
> > >
> > >
> > >
> > > Thanks
> > > Nic
> >
> > I'm afraid dde leaks memory, but Mark H hasn't confirmed this yet. Think
of
> > this if your app fails after a few thousand dde calls.
>
> Thanks for your help.
>
> I tried the corrections you suggested but I still get an exception
> while running the script from python.exe from the command line.
>
> The same script works fine inside the pythonwin environment.
>
> The problem only occurred on Win9X, on NT and 2000 it works OK.
>
> Do anybody know if this a general problem with the windows extensions
> or only with the DDE?
>
> Thanks
>
> Nic.
More information about the Python-list
mailing list