Before, all I have been doing is creating .cpp and .h files in the same root folder (where all your codes goes) and assign them to created filters. This, however, become an disadvantage when I switch from writing small program on my own to teamwork for my projects.
A filter in Visual C++ is, basically, a filter. It is not a directory that you put your code files into but rather some kind of "tag" that help you identify your code file. This makes your project cumbersome when you want to put the files into folders, each with a purpose (like Project\Logic, Project\GUI, etc)
Okay, that's enough of the chit chat, now let's do it
![]() |
Show All Files |
![]() |
Solution explorer with directory |
All you files should also be listed according to the directory they belong.
You can press the "+" / "-" button to expand, collapse your directories.
Finally, you can add in folder and files by right-click, Add -> New Folder / New Item
Of course, putting your files to folders requires some modification to the #include command. For example, you have to use
#include "SRS_HK\SimpleException_HK.h"to include the header file now.
Hope it helps :)