Author Topic: Catch output from executable  (Read 3039 times)

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Catch output from executable
« 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
Using V12

jfzouain

  • EA User
  • **
  • Posts: 151
  • Karma: +6/-1
    • View Profile
Re: Catch output from executable
« Reply #1 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.
Best regards

Jose Zouain

Stefan Bolleininger

  • EA User
  • **
  • Posts: 308
  • Karma: +0/-0
    • View Profile
Re: Catch output from executable
« Reply #2 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
Enterprise Architect in "safetycritical development" like medical device industry. My free Add-in at my Website

Paulus

  • EA User
  • **
  • Posts: 152
  • Karma: +0/-0
    • View Profile
Re: Catch output from executable
« Reply #3 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