Re: Redirecting input and output from a console

new topic     » goto parent     » topic index » view thread      » older message » newer message

Al Getz wrote:
> Abram Ring wrote:
> > 
> > 
> > I am creating a GUI interface for a Latin Dictionary programmed in Ada. 
> > Since I don't
> > know Ada, I want to use the compiled EXE of the dictionary program.
> > My program currently allows the user to select words in a Latin text to look
> > up and
> > then calls the dictionary in a console window.  This creates two problems
> > which I would
> > like to address:
> > 1) The black background and default font of the console window do not mesh
> > with the
> > smoother Richtext window I load the Latin text in.  2) The dictionary has to
> > be reloaded
> > for every word by calling "words.exe wordtolookup".
> > I would like to be able to load the dictionary in the background and have
> > the dictionary
> > output redirected into a message box or (even better) richtext box, and it
> > would also
> > be nice to be able to redirect input for the console.
> > Then I could just have the dictionary running and simulate keyboard entry to
> > look up
> > a word rather than reloading it from the command line each time.
> > 
> > Any help with redirecting would be appreciated; I am using Euph 2.5 and
> > win32lib.
> > 
> > 
> > Abram Ring
> > 
> Hi there,
> Does the exe you are now working with allow say this:
>   Lookup.exe "chair"
> (and then display the result in the console) ?
> Or, better yet, is the exe written in Euphoria where the input/output
> methods can be changed to suite and then re-bind'ed ?
> Take care,
> Al
> And, good luck with your Euphoria programming!
> My bumper sticker: "I brake for LED's"

The EXE can be invoked by "words.exe animus" to show the definition of "animus"
in a console window.
I can set the EXE to output to a file and then read the file into a Richtext
window.  My problem now is that when I shell to call the EXE with system() and
then load the output file, everything works.
However, when I use shellExecuteEx() so that I can hide console window which
pops up, the richtext window always shows the previous word looked up rather than
the word just selected.
Since there has been no change in the code other than replacing the system()
call with shellExecuteEx(), I suspect that somehow the shellExecuteEx() call is
not finished invoking the dictionary EXE before my program goes on to load the
output file.
In other words, I suspect system() suspends other activity until finished,
whereas shellExecuteEx() runs concurrently with the following code.
Does this seem right?  I am new to Windows programming.  Perhaps, I need to
somehow to have my program wait for the shellExecuteEx() process to complete.

new topic     » goto parent     » topic index » view thread      » older message » newer message


Quick Links

User menu

Not signed in.

Misc Menu