Python 3.2 PyRun_SimpleString-它在哪里
Python 3.2 PyRun_SimpleString - Where is it?
我正在尝试将一个应用程序与定制的Python发行版一起发布(添加了模块和我自己的扩展)。
为了保持简单,不冒与潜在现有设施发生冲突的风险,我认为最好的方法是运送。\DLL*.*和。\在一个子目录下用我的应用程序从\Python32\中解放*.*树。\MyApp\Python\
我只直接调用3个Py*函数:(代码是C++Builder…)
typedef void (__stdcall *PY_SETPYTHONHOME) (wchar_t *);
PY_SETPYTHONHOME Py_SetPythonHome;
typedef void (__stdcall *PY_INITIALIZE) ();
PY_INITIALIZE Py_Initialize;
typedef int (__stdcall *PYRUN_SIMPLESTRING) (const char *);
PYRUN_SIMPLESTRING PyRun_SimpleString;
HMODULE py_dll_hndle;
py_dll_hndle = ::LoadLibrary((ExtractFilePath(Application->ExeName) + "Python\DLLS\python3.dll").c_str());
ShowMessage(py_dll_hndle == NULL ? L"Bah" : L"Yay"); // Result: "Yay"
Py_SetPythonHome = (PY_SETPYTHONHOME) ::GetProcAddress(py_dll_hndle, "Py_SetPythonHome");
ShowMessage(Py_SetPythonHome == NULL ? L"Bah" : L"Yay"); // Result: "Yay"
Py_Initialize = (PY_INITIALIZE) ::GetProcAddress(py_dll_hndle, "Py_Initialize");
ShowMessage(Py_Initialize == NULL ? L"Bah" : L"Yay"); // Result: "Yay"
PyRun_SimpleString = (PYRUN_SIMPLESTRING) ::GetProcAddress(py_dll_hndle, "PyRun_SimpleString");
ShowMessage(GetLastError()); // Result: "127" (ERROR_PROC_NOT_FOUND)
ShowMessage(PyRun_SimpleString == NULL ? L"Bah" : L"Yay"); // Result: "Bah"
PyRun_SimpleString不存在?我一直在寻找使用http://www.nirsoft.net/DLL导出查看器。。。它不在那里。我很困惑。。。它在哪里?
使用python32.dll而不是python3.dll解决了问题。
为什么会有部分重复仍然是个谜。。。
相关文章:
- 理解boost::asio-async_read在无需读取内容时的行为
- 在提升multi_index容器中,是否定义了"default index"?
- 在执行其他功能的同时播放动画(LED矩阵和Arduino/ESP8266)
- 为什么在全局范围内使用"extern int a"似乎不行?
- 在C++/Linux中设置单调时钟的一些技巧
- 在C#中处理C++指针而不使用unsafe的最佳方法
- 为什么在popback()操作之后,它仍然打印完整的矢量
- 为什么随机数生成器不在void函数中随机化数字,而在main函数中随机化
- 使用C++库在Android项目中修改gradle中的cmake参数,用于插入指令的测试
- 无法在 CLion 中构建 C++ 项目
- 将字符串存储在c++中的稳定内存中
- C++17复制构造函数,在std::unordereded_map上进行深度复制
- 努力将整数转换为链表。不知道我在这里做错了什么
- 在全局变量中保存类的实例以重新创建类(创建"backup")
- 在C++STL中是否有Polyval(Matlab函数)等价物?
- 在C++中手动调整数组大小
- 在C++程序中输入的文本文件将不起作用,除非文本被复制和粘贴
- 在Ubuntu 16.04上安装Cilk时出现问题
- OpenGL - 在抛出"__gnu_cxx::recursive_init_error"实例后终止调用?
- QT在错误的班级中寻找空位