I'm on a CShrap tool to manage compilation of C++ projects using visual net
command line.
To build a specific configuration of my solution, I use the
System.Diagnostic.Process object, giving it this command line :
devenv.com /build "my solution configuration" "my solution".
I use .com extension fort devenv because I want to redirect standard output
into my Process to get compilation result on the fly.
I also don't want any IDE or window to open, I want the build to be
transparent to the user.
So by using this Process with correct parameters, everything works fine, the
build start, and during the build, window task manager tells me there are :
devenv.com, devenv.exe & cl.exe processus running.
my problem : I would like to be able to abort this compilation from withi my
CSharp tool...
If I try process.CloseMainWindow( ), it returns false because the process
has no windows, and so no message loop.
The doc tells me that the only way to stop a process that has no window is
to use Kill( ).
But if I call Kill( ), it does stop the devenv.com processus, but devenv.exe
& cl.exe keep running !
All the more, once cl.exe stops because a module build has finished,
devenv.exe starts another cl.exe for the next module, although devenv.com
does not run any more !!
So, calling Process.Kill( ) does not stop compilation ! It only stops
devenv.com... the build keeps going until it has finished the whole solution
configuration !
How can I stop the complete build process chain ?
Is there something I'm doing wrong ? Is there another way to start an
invisible build of a solution configuration, with more control on it, and
with the ability to redirect output to my tool ?
thanks
Sundari - 04 Jan 2005 10:47 GMT
Hi
Please read up this article from MSDN. This is an alternate solution to
automating a build process.
http://msdn.microsoft.com/vstudio/downloads/samples/automation2002/
Regards
Sundari.
> I'm on a CShrap tool to manage compilation of C++ projects using visual net
> command line.
[quoted text clipped - 33 lines]
>
> thanks