Win32 extension woes.
jriehl at mindspring.com
Wed Mar 15 06:48:11 CET 2000
I am trying to get SWIG to wrap the CDX library
(http://www.cdx.sk/), and it works great! Until I try to use the
wrapped library in a script. What I mean to say is that from the
interpreter, I can do all sorts of wacky stuff. However, as soon
as I move what I was typing from the interpreter into a script, one
of the C++ methods blows up.
I was hoping to co-opt some mindshare to ponder what I am
doing wrong (like trying to build a game library in Python...sheesh.)
I have tried the two ways of spinning threads: First I used the Win32
API call CreateThread() to spin a Win32 message handler for a new
window. After seeing that fail, I remembered something by Gordon
McMillan saying threads are better left in Python. So I tried
making a call to the wrapped message handler routine from a Python
The only thing that comes to mind is that there is some
sort of conflict between the two threads. When I am using the
command prompt, the main Python thread is primarily waiting for me
to do something, thus it is able to execute my changes to the
separate window. However, when a script is running, it is constantly
running, and the two threads collide. Since I am new to threading
on Win32, I was wondering what I could possibly do to test this
hypothesis (ie. how can I set up a VC++ environment that will allow me
to debug issues such as these)? Could anyone save my sanity a bit by
explaining how the Win32 port of Tk/Tcl operates on multiple windows,
assuming they have the answer? Assuming this goes deeper into
the DirectX or Windows layers, what should I be looking at to use
as a mutex?
Any help will be greatly appreciated.
More information about the Python-list