I am not a full time programmer, but I've been using MFC in multiple Visual Studio versions for some years while I've been writing the code to make my own tools that I needed to use mostly for my work.
Every time it took little effort, but it worked out gracefully with MFC. Most of the times, I've been using MDI rather than SDI, and I also wrote a couple programs in the dialog based structure as well. These tools helped me a lot and also made my co-workers happy as well.
I don't remember exactly when, but I noticed that Microsoft included the nice looking boilerplate framework which has the CFileView, CClassView, COutputWnd, and CPropertiesWnd classes. It definitely looks nicer and seems to complete the program in a better way. I was hoping to use these additions in my programs as well, but it required a lot more than what I could easily achieve.
My simple user model would be to list up the file names(Titles) interactively in the TreeView instead of having the "Fakexxxx.h" or "Fakexxxx.cpp".
I tried multiple google searches for the answer, but my search was not very successful so far. If someone could give a nice answer on this, that would be fantastic. I would like to provide one example program, HelloWorld, where TreeView shows the file name(s) once the files are open, and it also disappears when the file is closed.
Expected behaviors are ...
1. Add the filename or the title in the TreeView when the new file is open.(implemented in the example code)
2. Remove the item when the file/view/doc is closed.(implemented in the example code)
3. Browse to the corresponding view when the item in the TreeView is selected by LButton double click.
4. Remove the item and the corresponding view/doc when "Remove" is selected from the context menu in the TreeView.
Again, I am not a full time programmer, thus this program is not necessarily for the code example, but to give user model ideas. Please open up the program and try it yourself. I also added the 3 example files for you to try as well.
Visual Studio 2015 is used for this example, but I am pretty sure you would be able to compile the program under different Visual Studio versions.
Hmmm.. Bummer. I can't attach the zip file here. I tried to trick it by changing the file extension to txt, log, and pdf, but it didn't work out. I am just attaching the screenshot, but I would really like to share the code example with fellow programmer for some ideas. :)