初始化ListControl控件问题

voidCdblink3Dlg::AddToGrid(){adoconnm_AdoConn;m_AdoConn.OnInitADOConn();CStringsql;sq... void Cdblink3Dlg::AddToGrid()
{
adoconn m_AdoConn;
m_AdoConn.OnInitADOConn();
CString sql;
sql.Format("select* from student order by 编号 desc");
_RecordsetPtr m_pRecordset;
m_pRecordset=m_AdoConn.GetRecordSet((_bstr_t)sql);
while(m_AdoConn.m_pRecordset->adoEOF==0)
{
m_Grid.InsertItem(0,"");
m_Grid.SetItemText(0,0,(char*)(_bstr_t)m_pRecordset->GetCollect("ID"));
m_Grid.SetItemText(0,1,(char*)(_bstr_t)m_pRecordset->GetCollect("NAME"));
//m_Grid.SetItemText(0,2,(char*)(_bstr_t)m_pRecordset->GetCollect("性别"));
m_Grid.SetItemText(0,2,(char*)(_bstr_t)m_pRecordset->GetCollect("NUMBER"));
m_pRecordset->MoveNext();

}
m_AdoConn.ExitConnect();
}
发生错误:
:InsertColumn(int,LPCTSTR,int,int,int)' : cannot convert parameter 2 from 'const char [3]' to 'LPCTSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
e:\virtual studio exersize\dblink3\dblink3\dblink3dlg.cpp(115) : error C2664: 'int CListCtrl::InsertColumn(int,LPCTSTR,int,int,int)' : cannot convert parameter 2 from 'const char [5]' to 'LPCTSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
e:\virtual studio exersize\dblink3\dblink3\dblink3dlg.cpp(117) : error C2664: 'int CListCtrl::InsertColumn(int,LPCTSTR,int,int,int)' : cannot convert parameter 2 from 'const char [7]' to 'LPCTSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
请问高手是怎么回事?
展开
 我来答
研究报告站
2008-05-23 · TA获得超过195个赞
知道小有建树答主
回答量:441
采纳率:0%
帮助的人:319万
展开全部
InsertColumn第二个参数类型不对
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式