1234567891011121314151617181920212223242526272829 |
- // 下列 ifdef 块是创建使从 DLL 导出更简单的
- // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 RUNPYTHON_EXPORTS
- // 符号编译的。在使用此 DLL 的
- // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
- // RUNPYTHON_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
- // 符号视为是被导出的。
- #ifdef RUNPYTHON_EXPORTS
- #define RUNPYTHON_API __declspec(dllexport)
- #else
- #define RUNPYTHON_API __declspec(dllimport)
- #endif
- // 此类是从 RunPython.dll 导出的
- class RUNPYTHON_API CRunPython {
- public:
- CRunPython(void);
- // TODO: 在此添加您的方法。
- };
- extern RUNPYTHON_API int nRunPython;
- // 直接C++运行Python脚本;
- RUNPYTHON_API int RunPython(LPCTSTR lpScriptFile, LPCTSTR lpExtraSentence);
- // 实现标准错误输出;
- RUNPYTHON_API int RunPythonEx(LPCTSTR lpScriptFile, LPCTSTR lpExtraSentence);
- // 调用Python.exe来运行脚本;
- RUNPYTHON_API int CallPython(LPCTSTR lpScriptFile, LPCTSTR lpCommand);
- // 调用Python.exe来运行脚本,同时重定向输出流;
- RUNPYTHON_API int CallPythonEx(LPCTSTR lpScriptFile, LPCTSTR lpCommand);
|