how can i use mql to run extern ".exe" program

 

how can i use mql to run extern ".exe" program?

thanks everyone

 

it must work, but it isn't

#import "shell32.dll"
    int ShellExecute(int hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, int nShowCmd);
#import



int init() {

    ShellExecute(NULL, "open", "C:\\Windows\\Notepad.exe", NULL, NULL, 10);

    return (0);

}
 
try to write your own dll
 

Instead of opening notepad, request to open a file associated with notepad:

Example from a working script:

string theFile = path+"\\experts\\files\\reports\\MarketInfo_"+AccountCompany()+"_.txt";
ShellExecuteA(0, "open", theFile, NULL, NULL, 1);

 

yes, the problem was in ShellExecute(), it takes unicode strings.. ShellExecuteA() is true variant.

 

HI ~~~everybody~~~

help ~~~


dll lib must be in system32 folder ???

 
phy:

Instead of opening notepad, request to open a file associated with notepad:

Example from a working script:

string theFile = path+"\\experts\\files\\reports\\MarketInfo_"+AccountCompany()+"_.txt";
ShellExecuteA(0, "open", theFile, NULL, NULL, 1);

Hello,



It seems very good. But still not working. Could you give the whole script. Maybe it could help.

For example the "path" variable not definied.

Thanks a lot for your help.

 

string path = TerminalPath();

...

That is just an example... assign theFile with a string that represents the full path of the file you want to open, not my file, which doesn't exist on your machine.

 
thank all very much~~~
 
why I got this errors?
 

Which error?

Reason: