Win32 extension woes.

Jon Riehl jriehl at
Wed Mar 15 19:43:49 CET 2000

Mark Hammond wrote:
> What you are trying to do should work fine.
> It sounds like your problem is related to the Python thread lock -
> unfortunately, you havent given any specifics about the problems you
> are seeing.
> You may wish to check out the CEnterLeavePython class in the
> pywintypes project of the win32 extensions - this is a C++ class that
> manages acquiring the thread-lock before calling into Python.
> If the problem is not thread-lock related, you need to give us more
> details...

Fair enough, Mark.  Using SWIG, I have wrapped some parts of the CDX
library.  CDX sits on top of DirectX, and I am creating a separate
thread that opens a window, sets up a dummy message handling routine
and initializes the DirectX surfaces for the new window (via CDX.)
I then start manipulating the DirectX surface via CDX (such as the
CDXScree::Fill() method that fills the surface with a single color.)
When I do this from the command line interpreter, it works fine.
When I run this from a script, I can open a debugging session that
informs me that the CDXScreen::Fill() method has committed an access
violation.  In the disassembly, it seems it is stopping at various
parts of the method, but usually at a mov instruction.
Is there anything else I should be looking for?  It bothers me
somewhat that even though I compiled a debug DLL, VC++ is
opening with a disassembly and not the native code.


More information about the Python-list mailing list