> >     int tab_index =1;
> >     m_TabControl.SetCurSel(tab_index);      // m_TabControl is mapped.
> //But I get error C2065: 'm_TabControl' : undeclared identifier
> >}

I guess this is a new area for you.

You have a window + form view / dialogue with this tab control on, yes?

- Assuming VC6 (I'm afraid I don't know for VC.NET), press <Ctrl>W to bring
up the ClassWizard.
- Go to the Member Variables tab.
- In the Class Name box, ensure the class of your window holding the tab
control is selected. The ID of your tab control (e.g., IDC_TAB1) should
appear in the list below.
- Double-click the ID of the tab control, and a box should pop up - Add
Member Variable.
- In the Category box, ensure Control is selected (it should be by default).
- In the Variable type box, ensure CTabCtrl is selected (it should be by
default).
- In the Member variable name box, it should already have m_ - add
TabControl to this, so that it reads m_TabControl (be careful not to make it
m_m_TabControl by mistake!).
- Click OK. Then OK the ClassWizard.

What you have just done is usually known as "mapping a dialogue control to a
member variable". You have just created a variable of type CTabCtrl in your
class, and added the necessary macro to connect it with the control on the
dialogue resource.

Since it is mapped in this way, its Windows component becomes valid by the
time OnInitDialog() (or InitialUpdateView() for a form view) has completed.

Let us know if this works for you.

--
Jason Teagle
[EMAIL PROTECTED]




Reply via email to