I have a structure of the following
All the data members in the struct are the item and subitems that will be entered subsequently.Code:typedef struct { CString m_csKeyPressed; CString m_csCircleColor; CString m_csMouseX; CString m_csMouseY; }CircleParameters;
I want to be able to insert the item using
but it does not work. instead, if I do something likeCode:CircleParameters param; param.m_csKeyPressed = "Test"; param.m_csCircleColor= "Test"; param.m_csMouseX= "Test"; param.m_csMouseY= "Test"; m_ListCtrl.InsertItem((LVITEM*)¶m);
It works.Code:m_ListCtrl.InsertItem(m_nCircleCount,param.m_csKeyPressed); m_ListCtrl.SetItemText(m_nCircleCount,1,param.m_csCircleColor); m_ListCtrl.SetItemText(m_nCircleCount,2,param.m_csMouseX); m_ListCtrl.SetItemText(m_nCircleCount,3,param.m_csMouseY);
What am I doing wrong here?


Reply With Quote
