question on VC++ 6.0 [MFC]

Started by
4 comments, last by khalligan 19 years, 4 months ago
I'm in the process of creating a utility program for a game I'm designing. The main form view has a tree control containing all the items. You select an item, then click 'Edit Properties' to modify that item. Upon doing so, a dialog box opens up. Now to my problem... I want to put in a CTabCtrl object to organize the data, as there is quite a bit of it. I know how to create the ctrl, and I have a member variable setup for it in the dialog box. I don't, however, know how to add tabs or anything else to the control. I've searched online for tutorials, and cant find any that seem to cover this. I also can't seem to find any books that cover the topic very well. If anybody here could help me get started on this, I'd appreciate it greatly. Trickhat
Advertisement
You have to code it. You have to make a seperate dialog for each tab and load that dialog whenever the appro. tab is clicked on.
This is the type of thing that VB/Delphi/BCB/ and now .Net made much easier.

You can use ActiveX controls in MFC apps, though I never waded through that process so I don't know how easy or difficult it is. That would let you use the same tabbed dialog control that VB6 has.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Check out CPropertySheet and CPropertyPage
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
Well, I thought I got as far as inserting some tabs, but I keep getting "Assertion" errors...I have no idea what these are, or how to fix them...any ideas?

The code was as follows...

CTabCtrl m_tab;
m_tab.InsertItem(0, "Test");
//the above line produces an assertion error

Trickhat
Have you called Create on the tab control?
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
Try here.

You will need more than just CTabCtrl, you need a dialog resource for each of your tab pages (CPropertySheet).

This topic is closed to new replies.

Advertisement