c ++ MFC编译错误“C2470:'CMySink':看起来像一个函数定义,但是没有参数列表;跳过明显的正文”

时间:2012-08-21 05:43:34

标签: c++ com mfc

c ++ MFC编译错误

错误C2470:'CMySink':看起来像一个函数定义,但是没有参数列表;跳过明显的身体d:\ faxmanager \ faxmanager \ mysink.cpp 34

.h文件

class CMySink : public CCmdTarget
{
    DECLARE_DYNAMIC(CMySink)
...

protected:
    DECLARE_MESSAGE_MAP()    
     void OnJobAdded(FAXCOMEXLib::IFaxServer *pFaxServer, BSTR bstrJobId);
    ...
};

.cpp文件

BEGIN_DISPATCH_MAP(CMySink, CCmdTarget)
  DISP_FUNCTION (CMySink ,"OnOutgoingJobAdded", OnJobAdded, VT_EMPTY, VTS_I4 VTS_BSTR)
END_DISPATCH_MAP()

void CMySink:OnJobAdded(FAXCOMEXLib::IFaxServer *pFaxServer,  BSTR bstrJobId) 
{ 

}

1 个答案:

答案 0 :(得分:2)

void CMySink:OnJobAdded

应该是

void CMySink::OnJobAdded