add pywinalfred test project

This commit is contained in:
qianlifeng
2013-12-29 21:50:56 +08:00
parent 5893564f46
commit 188e7910dd
5 changed files with 323 additions and 0 deletions

View File

@@ -3,8 +3,11 @@
#include <thread>
#include <future>
int i = 0;
extern "C" __declspec(dllexport) void InitPythonEnv()
{
i++;
Py_Initialize();
PyEval_InitThreads();
}
@@ -27,6 +30,7 @@ char* Exec(char* directory, char* file, char* method, char* para)
{
PyObject *pName, *pModule, *pDict, *pFunc, *pValue, *pClass, *pInstance;
char *error;
i++;
PyThreadState* global_state = PyThreadState_Get();
PyThreadState* ts = Py_NewInterpreter();