函数为什么不执行?
我定义了一个函数在头文件中这样写的,
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CColor3Dlg)
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnButton1();
afx_msg void OnCustomdrawList(NMHDR*, LRESULT*);
//}}AFX_MSG
afx_msg void OnCustomdrawList(NMHDR*, LRESULT*);
DECLARE_MESSAGE_MAP()
};
然后再界面上我是这样写的
void CColor3Dlg::OnCustomdrawList ( NMHDR* pNMHDR, LRESULT* pResult )
{
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
*pResult = 0;
if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
{
*pResult = CDRF_NOTIFYITEMDRAW;
}
else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
{
COLORREF crText;
if ( (pLVCD->nmcd.dwItemSpec % 2) == 0 )
crText = RGB(255,0,0);
else
crText = RGB(128,128,255);
pLVCD->clrText = crText;
*pResult = CDRF_DODEFAULT;
}
}
我加了一个断点进行测试,为什么这个函数
问题点数:20、回复次数:3Top
1 楼theCFan(郁闷的饿猫)回复于 2005-05-15 12:35:50 得分 3
确定有消息吗?消息被派发到该类吗?
我也不知道,upTop
2 楼qrlvls( 空 气 )回复于 2005-05-15 12:49:44 得分 12
在.cpp中有没有消息映射宏?
ON_MESSAGE(...Top
3 楼krh2001(边城浪子)回复于 2005-05-15 13:03:19 得分 5
afx_msg void OnCustomdrawList(NMHDR*, LRESULT*);
--------------------------------------------------
请问这是一个什么消息Top




