From: "Tim Peters" <tim.one@comcast.net> > to make it easier someday. I believe Mark Hammond has a general set of C++ > classes to help with this stuff on Windows, but IIRC they rely on > Windows-specific TLS (thread local storage) gimmicks. Right. Here are the pointers: The class is CEnterLeavePython, near the end in http://www.pythonpros.com/cgi-bin/viewcvs.cgi/PyWin32/win32/src/PyWinTypes.h The helper functions are implemented in http://www.pythonpros.com/cgi-bin/viewcvs.cgi/PyWin32/win32/src/PyWinTypesmodule.cpp Thomas