Hey! I'm working with MFC (SDI) and I have 3 views in the window (TreeView, FormView and OpenGL). Everything is working ok.
Now I want to add a new item on the TreeView to display on the FormView the details of the selected item, however the new items belong to a different category and they will need a differente formview. My question is, How can I change the FormView from a Dialog (IDD_FORMVIEW1) to another (IDD_FORMVIEW2)...
Any suggestions???? Please help!!!

see this article. You should bookmark that site because it has a wealth of MFC code that you can freely use.

Ancient Dragon's link is pretty much on the topic .. you can also find some complete MDI/SDI examples, with and without splitters, by downloading the sample code of the The MFC Answer Book, freely available here:

There are three demo applications related to switching views:
SwitchViewMDI, SwitchViewSDI and SwitchViewSplitter

All in all, the .zip contains ~100 MFC demo applications.

Perfect!! Thank you so much for the information... I'll check it tonight!!

Thank you soo much!! Reading the article was well complemented by the code provided by mitrmkar!! Thanks to both of you!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.