There are some things that I don´t fully understand your scenario, such as
launching the IDE from the command line for a build and then trying to
attach an My ToolApp application to it while the build is being performed
but to my knowledge there are 2 ways to do what you want:
- You convert My ToolApp into an add-in, which is loaded with VS.NET when
the IDE is loaded from the command line for builds. In this case the
ConnectionMode parameter of the OnConnection method receives the value
Extensibility.ext_ConnectMode.ext_cm_CommandLine. Your add-in traps
pre-build and post build events or similar to perform its actions.
- My ToolApp is not an add-in but a standalone tool which creates an
instance of VS.NET and uses automation to control the IDE. You do this from
your tool with
objDTE = CreateObject("VisualStudio.DTE") (or similar statement for your
language)
Once you have the root objDTE, you can load a solution
(objDTE.Solution.Open), navigate its projects (objDTE.Solution.Projects) and
compile it (objDTE.Solution.SolutionBuild.Build), etc. Notice that in this
approach you don't use devenv.exe /build.

Signature
Carlos J. Quintero
MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
> Hello,
It all works well when I have
> the solution/project opened in VS .NET 2003 IDE, but I would like to make
> builds at night, so I call from the command line:
[quoted text clipped - 22 lines]
>
> thanks in advance
RafaelC - 11 Feb 2005 17:49 GMT
Hola Carlos,
Sorry for not describing the issue in a clear form. Ok, here's the scenario:
A .vcproj is created through wizards, once the project is created, I set the
"Configuration Type" to "Makefile" in the "General" page and in the "Build
Command Line" field of the "NMake" page settings, I put in my Win32 ToolApp
(EXE) I wrote. When "build" is selected, my ToolApp gets called and gets the
DTE and goes through the project sources and calls the compiler/linker, etc.
So ToolApp is not an add-in but rather a tool that uses the automation
interfaces.
All of the above works ok if I double click on the IDE and open the
solution/project and when I select build from the VS .NET menu, it calls my
ToolApp, etc.
Now, I want to build the project through the command line without having to
double click on the IDE open the project, etc, or without seeing an instance
of the IDE come up. I'd like to do:
devenv.exe "C:\myproject.sln" /build "Debug" /project "myproject"
and just build on the command line. With the command line above, my ToolApp
gets called correctly, but inside ToolApp I'm not able to get the DTE with
GetActiveObject().
Do you know if by using:
CreateObject("VisualStudio.DTE")
objDTE.Solution.Open
objDTE.Solution.Projects
would create a (visual) instance of the IDE?
I hope I explained it better this time, if not, please let me know. Any
other suggestions are welcomed.
Gracias
> There are some things that I don´t fully understand your scenario, such as
> launching the IDE from the command line for a build and then trying to
[quoted text clipped - 47 lines]
> >
> > thanks in advance
RafaelC - 11 Feb 2005 23:17 GMT
Ok, doing a CoCreateInstance does what I need.
nevermind...
thanks
> Hola Carlos,
>
[quoted text clipped - 84 lines]
> > >
> > > thanks in advance
RafaelC - 11 Feb 2005 20:01 GMT
By the way, I'm using C++ and not VB, what is a similar VB CreateObject()
call in C++? CoCreateInstance()?
If so, I don't think it will work as CoCreateInstance() will make the IDE
come up....
> There are some things that I don´t fully understand your scenario, such as
> launching the IDE from the command line for a build and then trying to
[quoted text clipped - 47 lines]
> >
> > thanks in advance