Hi,
// I need some help to embed the equivalent of the following Python code
in a C DLL.
from NLRclient import NLRclient
i = NLRclient("serv er")
s = i.getStrSort("q werty")
// This what I have so far:
PyObject *module, *i;
PyObject *arg , *kw;
// The following I will put in the DllMain entrypoint
Py_Initialize() ;
// from NLRclient import NLRclient
module = PyImport_Import ModuleEx( "NLRclient" , Py_BuildValue(" "),
Py_BuildValue(" ") , Py_BuildValue( "[s]", "NLRclient" ));
// i = NLRclient("serv er")
i = PyInstance_New( module, Py_BuildValue(" s","server") ,
Py_BuildValue(" "));
Up to here the program compiles but when I run the application, I get a
runtime error dialog.
//This will be placed in one of the Dll functions
// s = i.getStrSort("q werty")
How to I invoke a method from the created "i" instance ?
Py_Finalize();
return 0;
Many thanks,
Tertius
// I need some help to embed the equivalent of the following Python code
in a C DLL.
from NLRclient import NLRclient
i = NLRclient("serv er")
s = i.getStrSort("q werty")
// This what I have so far:
PyObject *module, *i;
PyObject *arg , *kw;
// The following I will put in the DllMain entrypoint
Py_Initialize() ;
// from NLRclient import NLRclient
module = PyImport_Import ModuleEx( "NLRclient" , Py_BuildValue(" "),
Py_BuildValue(" ") , Py_BuildValue( "[s]", "NLRclient" ));
// i = NLRclient("serv er")
i = PyInstance_New( module, Py_BuildValue(" s","server") ,
Py_BuildValue(" "));
Up to here the program compiles but when I run the application, I get a
runtime error dialog.
//This will be placed in one of the Dll functions
// s = i.getStrSort("q werty")
How to I invoke a method from the created "i" instance ?
Py_Finalize();
return 0;
Many thanks,
Tertius
Comment