Removing C++ SDK examples, clearly encouraging Python extensions
Tor Lillqvist
tml at iki.fi
Tue Apr 16 01:42:39 PDT 2013
>> 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
More information about the LibreOffice
mailing list