我设置断点,最后在
m_grid.SetItemText(0,0,(char*)(_bstr_t)m_pRecordset->GetCollect("编号"));
逐句显示错误,错误提示如下:
------------------------------------------------------Debug Assertion Failed!
Program: ... form_view_demo\sheet_in_view_demo\debug\sheetInView.exe
file :winctrl2.cpp
Line:494
For information on how your program can cause an assertion failure,see the Visual C++ documentation on asserts
(Press Retry to debug the application)
---------------------------------------------------
winctrl2.cpp 的第494行的代码是:
ASSERT((GetStyle() & LVS_OWNERDATA)==0);
请问下我是什么错误,谢谢,

解决方案 »

  1.   

    是否已经InsetItem了?具有LVS_OWNERDATA样式的虚拟列表控件应该在接到LVN_GETDISPINFO通知消息的时候提供相应内容,不能直接插入。
      

  2.   

    结贴。。原因是:原有的m_grid的变量没有与ListCtrl1进行关联,还有需要把ListCtrl1等列表控件的Styles中的Views属性设置为Report,原来的为icon.
        原有的m_grid的变量没有与ListCtrl1进行关联,还有需要把ListCtrl1等列表控件的Styles中的Views属性设置为Report,原来的为icon.