Changing the tabcontol tab titles

Hello guys...

I've added a tab control in a dialog and i named the tabs according to the lines below

TCITEM tabItem;
tabItem.mask = TCIF_TEXT;

tabItem.pszText = _T(" &Main "); //1st title
m_cTab.InsertItem(0, &tabItem);

tabItem.pszText = _T(" &Secondary ");//2nd title
m_cTab.InsertItem(1, &tabItem);

tabItem.pszText = _T(" Third ");//3rd title
m_cTab.InsertItem(2, &tabItem);

tabItem.pszText = _T(" Fourth ");//4th title
m_cTab.InsertItem(3, &tabItem);

Is there any way to map each title to a specific variable?

If i try to use an already defined CString variable (strText) for the tabs title using the code
TCITEM tabItem;
tabItem.mask = TCIF_TEXT;

tabItem.pszText = _T(strText); //I ve used strText for 1st title here
m_cTab.InsertItem(0, &tabItem);

..........
........

the error is:

error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class CString' (or there is no acceptable conversion)

Can anybody please help me?

Thank you very much
[1231 byte] By [thaikick] at [2007-11-20 11:46:41]
# 1 Re: Changing the tabcontol tab titles
CString strText = _T(" &Main "); //1st title
TCITEM tabItem;
tabItem.mask = TCIF_TEXT;

tabItem.pszText = strText.GetBuffer(0);
m_cTab.InsertItem(0, &tabItem);
...
VictorN at 2007-11-11 4:03:10 >
# 2 Re: Changing the tabcontol tab titles
Thank you very much VictorN... I''ll try it when i'm back home in the afternoon!

Thankssss !
thaikick at 2007-11-11 4:04:10 >
# 3 Re: Changing the tabcontol tab titles
It worked...Thank you very much VictorN
thaikick at 2007-11-11 4:05:08 >