Capturing Build Output on Win32

Stan Mitchell stanm@sourcequest.com
Wed Aug 23 06:53:00 GMT 2000


>
> I really do not know how to fix your problem. The entire system of console
> windows on Windows is severe voodoo. The only thing I can really suggest
is
> to change the invocation of premake.exe to "command premake.exe -?"; i.e.,
> launch your utility in a console window.
>

Yes, dealing with Win32 console windows is sometimes daunting.
I've had some luck at coming up with a solution for Win2k/WinNT.
Instead of directly spawning a build tool, I launch an intermediate
process, which I've tentatively named sncapture.exe. Using the example
I gave earlier, the Build dialog would have this command line:

     ../snav/bin/sncapture.exe c:/bin/premake.exe -?

sncapture spawns premake.exe using the inherited handles for
stdin/stderr/stdout
and it explicitly hides the new console window. It then does a
WaitForMultipleObjects on the process handle for premake.exe.
Using this approach all stderr and stdout goes into the browser window.
This is a general solution, it works equally well with other front-end
programs.

As it stands, this is a ~300 line applet, that can be used independently.
It would be more useful if it was integrated with SN, for example, it
could respond to the "Stop" button on the build dialog or it might be
prepended to build command lines if a check-box is checked.

Do you think this is something that might be useful as part of the
SN distribution? If so, I'm willing to do some more work on it.

-Stan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sncapture.zip
Type: application/zip
Size: 42812 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/sourcenav/attachments/20000823/6af363fc/attachment.zip>


More information about the Sourcenav mailing list