My advice is to always right-click on a project / solution when you want to Add something to your project, and then use the Location edit box in the file dialog box that VS throws out to put your items in the right place. Visual Studio seems to remember this place for the rest of your coding session, but, annoyingly, quickly forgets it if you close and reload the solution or exit VS.
I use the method above to manually create .cpp and .h files when creating a class. I stopped using the parameter of the Add Class element at that time because, as you discovered, it does not offer to set the location of the place where the resulting files will be returned. To right-click on a project, select Open Folder in File Explorer on the menu to open Windows Explorer for files, and then cut and paste .h and .cpp files into the folders in which I wanted them to quickly become tedious.
I would also like to know if there are better ways to “mix up” Visual Studio with the way we physically construct the folders of our projects more seamlessly and integrated. Perhaps the VS team needs to expand the Solution Explorer to help with the physical structure of folders, rather than being limited to logical filters? I suspect there are non-trivial reasons why this has not yet been done.
source share