Does anyone know an easy way how I can run a program from inside PowerLanguage?
My Strategy creates csv files. The strategy should send them to my ftp adress using the command line program cURL (http://curl.haxx.se/)
Any help very appreciated. Thanks
How to run another program from PowerLanguage [SOLVED]
- swz168
- Posts: 120
- Joined: 30 Sep 2010
- Location: Germany
- Has thanked: 47 times
- Been thanked: 32 times
Re: How to run another program from PowerLanguage [SOLVED]
For Multicharts 32 Bit Version, this thread would be the solution: viewtopic.php?f=1&t=8895&p=41983#p41970
Fury trader developed a 32bit dll for sending commands to the windows command shell.
Anyone knows about a 64bit dll for the same purpose?
Fury trader developed a 32bit dll for sending commands to the windows command shell.
Anyone knows about a 64bit dll for the same purpose?
Re: How to run another program from PowerLanguage
This is an old tread, but did you resolve the problem?For Multicharts 32 Bit Version, this thread would be the solution: viewtopic.php?f=1&t=8895&p=41983#p41970
Fury trader developed a 32bit dll for sending commands to the windows command shell.
Anyone knows about a 64bit dll for the same purpose?
Martin
- fbertram
- Posts: 166
- Joined: 16 Oct 2014
- Location: Seattle, USA
- Has thanked: 36 times
- Been thanked: 76 times
- Contact:
Re: How to run another program from PowerLanguage
This is code I successfully used on a 64 bit system:
This example shows how to implement a function named '_fub_Alert' which calls an external program named 'SendSMTP' with a few parameters.
Cheers, Felix
Code: Select all
Input:
message(StringSimple);
//------------------------------------------------------------------------------
// declare ShellExecuteA
DEFINEDLLFUNC: "shell32.dll", int, "ShellExecuteA",
lpstr, // HWND
LPSTR, // lpOperation,
LPSTR, // lpFile,
LPSTR, // lpParameters,
LPSTR, // lpDirectory,
INT; // nShowCmd
//------------------------------------------------------------------------------
variables:
HWND (""),
lpOperation ("open"),
lpFile (""),
lpParameters(""),
lpDirectory (""),
nShowCmd (0);
//------------------------------------------------------------------------------
lpFile = "SendSMTP";
lpParameters = "/SUBJECT mySubject /BODY " +DoubleQuote + message + DoubleQuote;
lpDirectory = "C:\Program Files (x86)\SendMail";
_fub_Alert = ShellExecuteA(
HWND,
lpOperation,
lpFile,
lpParameters,
lpDirectory,
nShowCmd);
Cheers, Felix