Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


 editbin /subsystem:console soffice.exe

It opens a console while LO is running but nothing is displayed there.
No error displayed, and “print” does nothing either.

Needed also for soffice.bin . (I don't recall, but it might be that
editbin doesn't believe a file called .bin is an exectuable, so you
might need to temporarily rename soffice.bin to foo.exe, run editbin
on it, and rename back.)

We could just add a few lines of code to a suitable place that would
make all our programs automatically show stdout and stderr in the
console shell if they are started from a such, on Windows. Something
like this, off the top of my memory:

if (_get_osfhandle (fileno (stdout)) != -1 &&
    _get_osfhandle (fileno (stderr)) != -1 ) {
  // stdout and stderr are fine, either this is a console program or
  // both have been redirected to a file.
} else {
  if (AttachConsole (ATTACH_PARENT_PROCESS)) {
    if (_get_osfhandle (fileno (stdout)) == -1)
      freopen ("CONOUT$", "w", stdout);
    if (_get_osfhandle (fileno (stderr)) == -1)
      freopen ("CONOUT$", "w", stderr);
  }
}

--tml

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.