VC6.0 成员函数指针问题(急!!)
class CTelnetConnect
{
public:
CTelnetConnect();
virtual ~CTelnetConnect();
public:
typedef BOOL (CTelnetConnect::*pSetBoardProductInfo)(CString BdId, const E_BOARD_PRODINFO& board);
pSetBoardProductInfo m_pSetBoardProductFunc;
public:
BOOL InstallFunc(CString csver);
BOOL SetBoardProductInfo(CString BdId, const E_BOARD_PRODINFO& board);
...
...
}
BOOL CTelnetConnect::InstallFunc(CString csver)
{
...
m_pSetBoardProductFunc = &CTelnetConnect::SetBoardProductInfo;
}
void CInfoForm::OnButtonYyong()
{
if (((CMainFrame*)AfxGetMainWnd())->m_pTelnetConnect->m_pSetBoardProductFunc != NULL)
{
if((((CMainFrame*)AfxGetMainWnd())->m_pTelnetConnect->*m_pSetBoardProductFunc)(it->GetName(), pro)) //m_pSetBoardProductFunc怎么不认识????
{
...
}
}
按语法来说应该是对的
但现在VC6.0 报
error C2065: 'm_pSetBoardProductFunc' : undeclared identifier
error C2297: '->*' : illegal, right operand has type 'int'