<div dir="ltr">Hi Torsten,<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 10, 2017 at 7:40 AM, Ben Coman <span dir="ltr"><<a href="mailto:btc@openinworld.com" target="_blank">btc@openinworld.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="gmail-"><br>
On Fri, Mar 10, 2017 at 10:49 PM, Torsten Bergmann <<a href="mailto:astares@gmx.de">astares@gmx.de</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> for the virtual machine on Windows we have a UI VM and a headless console version. For instance "Squeak.exe"/"Pharo.exe"/... (UI VM) and<br>
> "SqueakConsole.exe"/"<wbr>PharoConsole.exe"/... (Console version to access stdin, stdout and stderr)<br>
><br>
> IMHO there is no need for a separate and special console version on Windows. Maybe it was the easiest/quickest way to implement this<br>
> but usually one should be able to access/create and redirect the std handles even in a UI application. See<br>
><br>
> <a href="http://dslweb.nwnexus.com/~ast/dload/guicon.htm" rel="noreferrer" target="_blank">http://dslweb.nwnexus.com/~<wbr>ast/dload/guicon.htm</a><br>
<br>
</span>As I understand that article, to get stdio from a GUI app you'll be<br>
popping up that awful black window on screen...<br>
"its possible for your GUI application to<br>
explicitly create a  **console window**<br>
and then manually associate standard C I/O handles (FILE*) with the<br>
appropriate Win32 handles"<br>
<br>
The following dance might be more what you're looking for...<br>
"How to make an application as both GUI and Console application?"<br>
<a href="https://blogs.msdn.microsoft.com/junfeng/2004/02/06/how-to-make-an-application-as-both-gui-and-console-application/" rel="noreferrer" target="_blank">https://blogs.msdn.microsoft.<wbr>com/junfeng/2004/02/06/how-to-<wbr>make-an-application-as-both-<wbr>gui-and-console-application/</a><br>
<br>
<br>
btw, I found these interesting...<br>
<br>
"What’s the difference between the COM and EXE extensions?"<br>
<a href="https://blogs.msdn.microsoft.com/oldnewthing/20080324-00/?p=23033" rel="noreferrer" target="_blank">https://blogs.msdn.microsoft.<wbr>com/oldnewthing/20080324-00/?<wbr>p=23033</a><br>
<br>
"Difference between .com program and .exe program in c programming language"<br>
<a href="http://www.cquestions.com/2011/02/difference-between-com-program-and-exe.html" rel="noreferrer" target="_blank">http://www.cquestions.com/<wbr>2011/02/difference-between-<wbr>com-program-and-exe.html</a></blockquote><div><br></div><div>Ben is quite right (as usual).  Remember the use case is piping input to and output from the VM.  e.g.</div><div><br></div><div>   > PharoConsole.exe PharoCommand.image <input.txt >output.txt</div><div>   > foo.exe | PharoConsole.exe PharoCommand.image | bar.exe</div><div><br></div><div><br></div><div>This *does not work* for a GUI app.  So yes, we do need the separate versions.  Now, one *can* reduce the overhead by packaging the VM proper as a DLL and loading it into two very small Pharo,exe and PharoConsole.exe programs (as was done with VisualWorks), but the need for two separate programs remains and is "baked into" the "design" of Windows(tm).</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
<br>
cheers -ben<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
><br>
> for a start. Maybe it is possible to get rid of a separate "XXXConsole.exe" version so the VM on Windows behaves like on other platforms.<br>
> Maybe that als unifies/eases the build.<br>
><br>
> Side note:<br>
> Maybe there is also a difference when you start an executable with Explorer (double click) where you might need to create a new console vs.<br>
> starting the executable from an already existing console command line (where it might be possible to catch an existing handle). But this<br>
> could be evaluated with a simple C executable and (if working) transformed to the Open Smalltalk virtual machine.<br>
><br>
> Bye<br>
> T.<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>