I have an application written in Python.
The application calls some functions in the dll (using ctypes) that calls some functions from the python C API to load and run some functions in a (different) python module. This causes WindowsError: exception: access violation reading 0x00000004 Some cout debugging tells me that the access violation happens on a call to the Python C API.
I know the DLL successfully loads the python module, running to completion when I test it as a stand alone .exe but when it is run from the python application it gives this access violation error.
I first though that maybe I should use Py_NewInterpreter in the DLL to create a new separate space for these python module functions to run. This would seem convienent as there is no need for the application and the modules runs by the DLL to share any data. http://docs.python.org/2/c-api/init.html#Py_NewInterpreter
However my initial tests with Py_NewInterpreter have proved unsuccessful simply making further errors and crashing.
So my question is how should I implement this/what do I need to do make the DLL load of the python modules work?