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

关于虚函数的有关问题,

2012-08-08 
关于虚函数的问题,求救!error C2555: CShowJPEGDoc::OnOpenDocument : overriding virtual function dif

关于虚函数的问题,求救!
error C2555: 'CShowJPEGDoc::OnOpenDocument' : overriding virtual function differs from 'CDocument::OnOpenDocument' only by return type or calling convention
声明是这样的
protected:
//{{AFX_MSG(CShowJPEGDoc)
afx_msg void OnOpenDocument(LPCTSTR lpszPathName);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
定义如下
void CShowJPEGDoc::OnOpenDocument(LPCTSTR lpszPathName) 
{
// TODO: Add your command handler code here
DecodeJPGFileToGeneralBuffer(lpszPathName, &width, &height, &buffer, &nchannels);// 得到图像的数据
DecodeJPGFileToDIB(lpszPathName, &dib);// 得到图像的信息头
flag=TRUE;
}

[解决办法]
楼主从提示错误信息应该看出来什么吧。其实原型是这样的啦。

C/C++ code
virtual BOOL OnOpenDocument(   LPCTSTR lpszPathName ); 

热点排行