CString strText;
strText.Format(TEXT("%d"),menuSet.m_DishID);m_ctlListMenu.InsertItem(i,strText);
menuSet.m_DishID是一个长整型变量,InsertItem函数的第二个参数必须为LPCTSTR类型,而menuSet.m_DishID为数据库自动编号而成的长整型数据,所以要转换。
CString strText;
strText.Format(TEXT("%d"),menuSet.m_DishID);m_ctlListMenu.InsertItem(i,strText);
menuSet.m_DishID是一个长整型变量,InsertItem函数的第二个参数必须为LPCTSTR类型,而menuSet.m_DishID为数据库自动编号而成的长整型数据,所以要转换。