RunPython.h 1.0 KB

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