首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

关于VC中函数数组指针的有关问题!error C2064: term does not evaluate to a function

2012-04-18 
关于VC中函数数组指针的问题!error C2064: term does not evaluate to a function函数数组中的指针指向我

关于VC中函数数组指针的问题!error C2064: term does not evaluate to a function
函数数组中的指针指向我的类中定义的函数。
方法如下:

头文件中的定义:
class   CMyClassDlg   :   public   CDialog
{
      ........
      typedef       void   (CMyClassDlg   ::*   PFUNCTION)();   //类型
      PFUNCTION   pFuncArray[5][7];     //这个是函数指针数组
      .......

protected:
      afx_msg   void   On0103();         //需要被指向的函数
}

//.cpp函数中的使用
//下面是初始化:
BOOL   CMyClassDlg   ::OnInitDialog()
{
      pFuncArray[0][0]   =   &CMyClassDlg::On0103;     //这里敷值,编译通过
}

//下面是调用,此处出错
void   CMyClassDlg   ::Application()
{
      *(pFuncArray[0][0])();  
      //这里编译出错,不管怎么改都提示
      //error   C2064:   term   does   not   evaluate   to   a   function


[解决办法]
(this-> *(pFuncArray[0][0]))();
嘿嘿!

热点排行