I have had a couple of problems with VS 2012 (may be in other versions). I have a solution where I have a number of subfolders. Yesterday I went to the resource view and inserted a new dialog. I double clicked the dialog and gave the class a name. Two files were generated as I expected. One was the class.h file and the other the class.cpp file.
Then I tried to do a build. I got a ton of errors. After a bit I just removed the new files from the project. I also went to TFS and undid my pending changes for the vcxproje file. Still got all the erorrs. After a while I finally figured out what the heck had happened. VS 2012 created a new stdafx.h file and dropped it into my base directory. So when my existing stdafx.h file was being referenced, the new (and quite empty) stdafx.h file was used instead.
Holy compilation errors Batman, why did VS 2012 dump that new stdafx.h file out?
Now move on to today. I went to the class view and found my dialog class and used the class wizard to add a method. This time the IDE created yet another .cpp file in my include directory (where I moved the .h file generated yesterday and btw where my true stdafx.h file resides). So now I have to undo all that too (copy code to actual .cpp file created yesterday that I moved to a source subfolder of the project folder, delete new file from disk, undo pending changes waiting to create the cpp file emitted today in the include folder).
I know it must be very difficult for the IDE to keep up with such a complicated solution where I have a "Header Files" subfolder for include files, and a few other folders where I keep related source files.
However oddly enough, I can simply use "go to definition" on any method when I am in my dialog's include file and lo and behold, the IDE takes me to the existing cpp file in the folder in which I have placed it.
So perhaps the code wizards can be rewritten to be as smart os the go to definition command so it can find the source file that has all the existing code in it. That way every time I use the class wizard to add a method, it won't create a new source file.
As for the frustration created by that new stdafx.h file, I think from now on I'll just skip the file creation wizard.
R.D. Holland