CString to const char* conversion?
-
Hi, CString strBuffer(""); int count=1; count= m_cCombo.GetCurSel(); if(count!=CB_ERR) { m_cCombo.GetWindowTextW(strBuffer);
const char* temp=strBuffer; // here I'm stuck
m_nCount=atoi(temp); }
-
Hi, CString strBuffer(""); int count=1; count= m_cCombo.GetCurSel(); if(count!=CB_ERR) { m_cCombo.GetWindowTextW(strBuffer);
const char* temp=strBuffer; // here I'm stuck
m_nCount=atoi(temp); }
-
Hi, CString strBuffer(""); int count=1; count= m_cCombo.GetCurSel(); if(count!=CB_ERR) { m_cCombo.GetWindowTextW(strBuffer);
const char* temp=strBuffer; // here I'm stuck
m_nCount=atoi(temp); }
-
Hi, CString strBuffer(""); int count=1; count= m_cCombo.GetCurSel(); if(count!=CB_ERR) { m_cCombo.GetWindowTextW(strBuffer);
const char* temp=strBuffer; // here I'm stuck
m_nCount=atoi(temp); }
What about
if( m_cCombo.GetCurSel()!= CB_ERR)
{
CString strText;
m_cCombo.GetWindowText(strText);
m_nCount = _tstoi( strText );
}? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]