VisualStudio 2010 , C++ Commandline Anwendung und Python 2.7 mit wxPython2.8-win32-ansi-2.8.11.0-py27 alles 32 bit
Code: Alles auswählen
#include <Python.h>
int main(int argc, char *argv[])
{
PyObject *pName, *pModule, *pDict, *pFunc, *pValue;
PyObject *mod;
Py_Initialize();
PyRun_SimpleString("import wx");
mod = PyImport_ImportModule("wx");
if (mod == NULL)
printf("Error");
//return 1;
pName = PyString_FromString("newwindow");
// Load the module object
pModule = PyImport_Import(pName);
// pDict is a borrowed reference
pDict = PyModule_GetDict(pModule);
// pFunc is also a borrowed reference
pFunc = PyDict_GetItemString(pDict,"start");
if (PyCallable_Check(pFunc))
{
PyObject_CallObject(pFunc, NULL);
} else
{
PyErr_Print();
}
// Clean up
Py_DECREF(pModule);
Py_DECREF(pName);
return false;
}
Code: Alles auswählen
File "C:\Prog\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.py", l
ine 45, in <module>
from wx._core import *
File "C:\Prog\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line
4, in <module>
import _core_
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.
Error
Sollte das überhaupt gehen? Macht es Sinn da weiterzusuchen. Leider habe ich dazu nichts brauchbares gefunden.
Wie könnte ich sonst aus c++ / dll heraus ein Python Fenster anzeigen lassen
Vielen Dank für jede Hilfe