Problem solved! Python can now be used from mql4, even multithreading EAs, network servers, etc. are now possible! Here is the project: http://sites.google.com/site/prof7bi...on-integration
------------------------- original posting ------------------------
Since here are many programmers looking for challenging tasks, here is one:
Make the following lines of code work so that it doesn't immediately segfault when calling PyRun_SimpleString(). I assume there is something wrong with the way metatrader passes strings to c functions. but i have no idea how to fix it. From what i know PyRun_SimpleString() argument is defined as
other sources i found via google mention something like
I have no idea how to express the above in mql4 or whether there is another error in the way i am approaching this:
TIA,
Bernd
------------------------- original posting ------------------------
Since here are many programmers looking for challenging tasks, here is one:
Make the following lines of code work so that it doesn't immediately segfault when calling PyRun_SimpleString(). I assume there is something wrong with the way metatrader passes strings to c functions. but i have no idea how to fix it. From what i know PyRun_SimpleString() argument is defined as
Inserted Code
char *command
Inserted Code
const char *command
Inserted Code
#import "python26.dll" void Py_Initialize(); void Py_Finalize(); int PyRun_SimpleString(string code); #import int init(){ Py_Initialize(); PyRun_SimpleString("42"); Py_Finalize(); return(0); }
Bernd