本人编写了一个为列表框添加位图背景的程序,为防止背景闪烁分别重载了WM_HSCROLL、WM_LBUTTONDOWN和=LBN_SELCHANGE的消息响应函数,添加代码如下
void CBKListBox::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
invalidate();
CListBox::OnVScroll(nSBCode, nPos, pScrollBar);
}
void CBKListBox::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
invalidate();
CListBox::OnHScroll(nSBCode, nPos, pScrollBar);
} void CBKListBox::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
invalidate();
CListBox::OnLButtonDown(nFlags, point);
} void CBKListBox::OnSelchange()
{
// TODO: Add your control notification handler code here
invalidate();
}
但编译的时候发现出现E:\c++程序\E0410\BKListBox.cpp(105) : error C2065: 'invalidate' : undeclared identifier
Error executing cl.exe.这是怎么回事。
invalidate()的调用需要其它函数的调用吗,还是应该对其定义,应该如何定义。希望大家帮帮忙
void CBKListBox::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
invalidate();
CListBox::OnVScroll(nSBCode, nPos, pScrollBar);
}
void CBKListBox::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
invalidate();
CListBox::OnHScroll(nSBCode, nPos, pScrollBar);
} void CBKListBox::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
invalidate();
CListBox::OnLButtonDown(nFlags, point);
} void CBKListBox::OnSelchange()
{
// TODO: Add your control notification handler code here
invalidate();
}
但编译的时候发现出现E:\c++程序\E0410\BKListBox.cpp(105) : error C2065: 'invalidate' : undeclared identifier
Error executing cl.exe.这是怎么回事。
invalidate()的调用需要其它函数的调用吗,还是应该对其定义,应该如何定义。希望大家帮帮忙
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货