求助!!vc++2005程序编译出错,vc6没问题
共有三个编译错误,但是在vc6却没有问题,2005无法通过,求达人帮助错误说明: “static_cast”: 无法从“void (__thiscall COutputView::* )(const CString *)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”
afx_msg void OnAddString(const CString* str); //头文件声明
ON_MESSAGE(UMSG_ADDSTRING,OnAddString)
void COutputView::OnAddString(const CString* str) //源函数定义
{
m_strList.AddTail(*str);
CSize size = GetTotalSize();
int height = m_strList.GetCount()*m_FontHeight;
if(height > size.cy){
SetScrollSizes(MM_TEXT,CSize(500,height));
POINT pt;
pt.x = 0;
pt.y = height;
ScrollToPosition(pt);
}
Invalidate(FALSE);
MSG msg;
if(::PeekMessage(&msg,NULL,0,0,PM_REMOVE)){
::SendMessage(msg.hwnd, msg.message, msg.wParam, msg.lParam);
}
}
错误说明:“static_cast”: 无法从“void (__thiscall COutputView::* )(void)”转换为“LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)”
afx_msg void OnRemoveAllString(); //头文件声明
ON_MESSAGE(UMSG_REMOVEALLSTRING,OnRemoveAllString)
void COutputView::OnRemoveAllString() //源函数定义
{
m_strList.RemoveAll();
SetScrollSizes(MM_TEXT,CSize(500,200));
Invalidate(FALSE);
MSG msg;
if(::PeekMessage(&msg,NULL,0,0,PM_REMOVE)){
::SendMessage(msg.hwnd, msg.message, msg.wParam, msg.lParam);
}
}
错误说明: “static_cast”: 无法从“UINT (__thiscall CCoolDialogBar::* )(CPoint)”转换为“LRESULT (__thiscall CWnd::* )(CPoint)”
afx_msg UINT OnNcHitTest(CPoint point); //头文件声明
UINT CCoolDialogBar::OnNcHitTest(CPoint point) //源函数定义
{
if (IsFloating())
return CControlBar::OnNcHitTest(point);
CRect rc;
GetWindowRect(rc);
point.Offset(-rc.left, -rc.top);
if(m_rectClose.PtInRect(point))
return HTSYSMENU;
else if (m_rectUndock.PtInRect(point))
return HTMINBUTTON;
else if (m_rectGripper.PtInRect(point))
return HTCAPTION;
else if (m_rectBorder.PtInRect(point))
return HTSIZE;
else
return CControlBar::OnNcHitTest(point);
}
[[it] 本帖最后由 网球浪子 于 2008-5-21 21:07 编辑 [/it]]