Page 1 of 1

Console Applications and Redirection

Posted: Fri Aug 07, 2009 12:05 pm
by ConvertFromOldNGs
by ssi >> Wed, 12 Dec 2001 22:41:42 GMT

I'm trying to work out how you can spawn a console app and have its output redirected into a jade program.

So far from what I've seen it seems to involve jade connection pipes maybe?

Anyone managed to do this?

Re: Console Applications and Redirection

Posted: Fri Aug 07, 2009 12:05 pm
by ConvertFromOldNGs
by MITCHELL1 >> Thu, 20 Dec 2001 0:19:16 GMT

Sam

If you have CardSchema then there is an undocumented entry point in the CardSchema released karma.dll which we use in the JADE Systems Management tool set to run external processes and capture standard output. The entry point is for an external method emCreateProcess which has the following signature:

emCreateProcess(
obj: Object;
cmdLine: String;
modal: Boolean;
notifyStdOut: Boolean;
childStdInText: String;
tag : Integer;
exitCode: Integer output): Integer is "emCreateProcess" in "karma" ;

To use this, we first start a secondary 'logger' thread that will receive standard output via notifications on the object specified in the 'obj' parameter with the tag value defined in the 'tag' parameter. The primary thread then performs the emCreateProcess call, passing in the required command line. If modal=true then the thread will hang at that point until the console process completes, at which time the exitCode of the process that you ran can be accessed.

Hope this helps

--
Richard W Mitchell
JADE Direct Technologies
mailto: rmitchell@jade.co.nz