Click to See Complete Forum and Search --> : Visual Studio .NET Build / Execute App
KMerker
July 26th, 2004, 10:51 AM
While developing a C++ App using VS.NET, all of a sudden, my App automatically executes right after I perform a Build. This is annoying.
It is a project specific setting because it doesn't do this on other projects.
I don't recall changing any settings, but I must have by accident. Any ideas on how to turn this setting off?
Thanks,
kuphryn
July 26th, 2004, 11:05 AM
Did you select build from the menu or did you press a key?
Kuphryn
KMerker
July 26th, 2004, 11:28 AM
Did you select build from the menu or did you press a key?
Kuphryn
When I select Build from the menu.
It only executes the app if it had to re-compile one or more of the cpp files. So, if I make a program change, then select Build, it builds it, if there are no errors, it automatically runs the app.
Andreas Masur
July 26th, 2004, 02:51 PM
[ Moved thread ]
KMerker
July 26th, 2004, 08:48 PM
Ok, here was the problem. This drove me nuts and I had to figure it out before doing anything else.
When I added ATL support it must then launch the program for some reason after linking. ATL support adds the lines,
// App was launched with /Register or /Regserver switch.
if (cmdInfo.m_nShellCommand == CCommandLineInfo::AppRegister)
{
_AtlModule.UpdateRegistryAppId(TRUE);
_AtlModule.RegisterServer(TRUE);
return FALSE;
}
The linker launces the program with the Regserver switch. So these statements would close the app immediately and I would never no the app ran.
However, in earlier code, I had commented out the line,
ParseCommandLine(cmdInfo);
Therefore the if block returned false and the program continued to run
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.