Best way to solve dual call???
Michal Wallace
sabren at manifestation.com
Mon Jul 31 16:09:31 EDT 2000
On Mon, 31 Jul 2000, Arinté wrote:
> I have this app that allows python scripts to talk to devices thru a c++ app
> and a dll. At certain times the device may need to send a message to the
> script like COVER_OPENED/COVER_CLOSED. Currently, it is giving me a error
> in the Thread State stuff. It works ok if there is a call to the script and
> while that call is being made then send the message. Example I have a
> messagebox in my dll that python scripts can pop up, while the script is
> waiting for that messagebox to go away Messages from the device can safely
> make it in. I could tell the testers to popup a window whenever a message
> may be expected, but that is not practical or possible. Any hints on what I
> could do?
If you want a DLL to send a message back into your program, you're
probably talking about having a callback routine to catch it, right?
I ran into this situation trying to script a MIDI keyboard. Every
time I pressed a note, python would completely crash.
I don't know if this is the ONLY way to solve the problem, but I found
it works best to have the callback written in C, and compile it as a
python module.
I'm not a very good C programmer (so I can't tell you much more
than that) but I got the code working, and you can see it at
http://www.sabren.com/code/python/midi/
Cheers,
- Michal
------------------------------------------------------------------------
www.manifestation.com www.sabren.com www.linkwatcher.com www.zike.net
------------------------------------------------------------------------
More information about the Python-list
mailing list