Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: SomersetGraham on May 18, 2013, 12:46:27 am

Title: Catch output from executable
Post by: SomersetGraham on May 18, 2013, 12:46:27 am
Hi
I am running from executable from within EA.
The executable produces output in a console which is fine when it run from the command line, however when running in EA a console is briefly displayed before it disappears.
Is there an easy way to redirect the output of my application to the System output panel in EA?

Thanks
Title: Re: Catch output from executable
Post by: jfzouain on May 18, 2013, 12:50:43 am
Hi

I remember this happened to me long time ago (5+ years), but not with EA. How I solved it was alocating memory to the execuatable via the parent program.
Don't know how to do that with EA.
Title: Re: Catch output from executable
Post by: Stefan Bolleininger on May 20, 2013, 06:24:58 am
How do you open your application from within EA?

One idea - which came quite on the fly(not approved  8-) ): Create a little application where you redirect your standardoutputs or erroroutput.

Stat your new app  ;D

Cheers
Stefan
Title: Re: Catch output from executable
Post by: Paulus on May 20, 2013, 05:18:08 pm
If you can use the EA automation API from your application:

First get a reference to the Repository object of your running EA instance (http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/app.htm).

Then:

- CreateOutputWriteOutput  => creates an extra tab in the EA output view
- EnsureOutputVisible => makes it visible in EA
- WriteOutput => to write to it
- RemoveOutputTab => kills the tab

Note that this only works as expected when running a single EA instance.

best regards,

Paulus