现在要对ListCtrl中的某个表格中的内容进行编辑,我凑合了一些代码如下,错误很多,还望各位帮帮忙:
void   ListCallbackFun(void)
{
    CStore::m_nitem = CStore::m_StoreList.GetItem();//获得行坐标
    CStore::m_nsubitem = CStore::m_StoreList.GetSubItem();//获得列坐标
    CPoint pt(LOWORD(CStore::m_nitem), HIWORD(CStore::m_nsubitem));
    ScreenToClient(&pt);//要转化为客户端坐标
//错误:error C2660: 'ScreenToClient' : function does not take 1 parameters
可我看人家都是用一个参数的啊~~~
   // Get indexes of the first and last visible items in 
   // the listview control.
  int index = GetTopIndex();
//错误:error C2065: 'GetTopIndex' : undeclared identifier
//GetTopIndex是CListCtrl类的基类,那我该怎么引用
   int last_visible_index = index + GetCountPerPage();
//error C2065: 'GetCountPerPage' : undeclared identifier
   if (last_visible_index > GetItemCount())
//error C2065: 'GetItemCount' : undeclared identifier
       last_visible_index = GetItemCount();   // Loop until number visible items has been reached.
   while (index <= last_visible_index)
   {
       // Get the bounding rectangle of an item. If the mouse
       // location is within the bounding rectangle of the item,
       // you know you have found the item that was being clicked.
       CRect r;
       GetItemRect(index, &r, LVIR_BOUNDS);
//error C2065: 'GetItemRect' : undeclared identifier
       if (r.PtInRect(pt))
           {
               UINT flag = LVIS_SELECTED | LVIS_FOCUSED;
               SetItemState(index, flag, flag);
error C2065: 'SetItemState' : undeclared identifier
               break;
          }       // Get the next item in listview control.
       index++;
   }   *pResult = 0;
//error C2065: 'pResult' : undeclared identifier
//error C2100: illegal indirection
}我包含了头文件CMyListCtrl.h头文件进去了啊怎么还不行

解决方案 »

  1.   

    该 ListCallbackFun(void)函数是CStore类(从CPropertyPage基类派生)中的成员函数。那我现在在这个函数中要用到GetItemRect/GetItemCount....等CListCtrl类中的成员函数那该怎么办??
      

  2.   

    现在只有这两个错误:
    ScreenToClient(&pt);
    //error C2660: 'ScreenToClient' : function does not take 1 parameters
    那该怎么改??
    还有就是:
      *pResult = 0;//error C2100: illegal indirection
    大虾帮帮忙哪!!
      

  3.   

    系统处在崩溃的状态,
    CPU占用90以上,那是代码哪里出问题了?
      

  4.   

    你的ScreenToClient是不是加了::强制引入了全局的ScreenToClient?把他去掉