I am using visual studio 2013
I hi-lighted a header file (CandyBox.h) in Solution Explorer and hit the delete key.
The file is gone in the folder.
So I thought that the code below should not compile and run.
But much to my surprise it compiles and runs just fine even after I got rid of the header.
How can this be? Where did that file go? Where is Visual Studio getting my class definition from. When the file is not there?
Yes I looked at the folder in Windows Explorer.
There is definitely no file named CandyBox.h anywhere in that project folder.
But it still builds and runs. I even altered the text slightly to make sure it was recompiling.
I forgot to mention that I had originally dragged and dropped the file from a windows folder into solution explorer.
I can see from reading the file CL.read.1.tlog inside of my visual studio folder that it includes a reference to the absolute path of the CandyBox.h header file from its original source which is outside of the project directory. (The file still does exist at that location.)
Maybe that explains why it still builds.
But it doesn't answer the question, what happens when I hi-light a file and then hit delete.
Ok I think i figured out the answer if you hi-light and delete and it exists in the folder of the project you get a prompt that gives you the option to remove or delete. That works pretty self explanatory. And does what it is expected to do.
The thing I cannot figure out is if the file you hi-lighted a file and then removed, but not permanently deleted, what happens. Where are the instructions to keep using it. It becomes invisible in solution explorer, but still builds. It keeps getting included in that CL.read.1.tlog file. WHY??? I understand I can just delete it permanently but I want to do it from within visual studio and I want to understand what is happening.
Maybe it will be helpful to explain why I want to do this.
I want to have part of my program removed. I want to see that the program does not compile and then I want to include the removed portion via DLL file and see that it compiles.
I don't understand how to remove it properly from within visual Studio.
It becomes invisible in solution explorer, but still builds.
Because solution explorer has nothing at all to do with the build process. The build process happens at the command line, using a command line executable. Solution explorer is a helpful way for you to organise your files.