Message Mapping for a template class
- From: "Mehran Ziadloo" <mehran20@xxxxxxxxxxx>
- Date: Tue, 9 Aug 2005 10:14:46 +0430
Hi,
My problem is about Message Map and template classes. Since I'm not that
professional with MFC I can't find my way out.
I have a class that has inherited from CListCtrl and I want it to be
template class. This class must be able to handle some of the Windows
Messages too.
So I wrote the following macro as follow:
BEGIN_MESSAGE_MAP(CMyListCtrl, CListCtrl)
//{{AFX_MSG_MAP(CMyListCtrl)
ON_NOTIFY_REFLECT(LVN_BEGINDRAG, OnBeginDrag)
ON_WM_LBUTTONUP()
ON_WM_CHAR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
But complier didn't accept it, so I changed it to:
BEGIN_MESSAGE_MAP(CMyListCtrl<Item>, CListCtrl)
//{{AFX_MSG_MAP(CMyListCtrl)
ON_NOTIFY_REFLECT(LVN_BEGINDRAG, OnBeginDrag)
ON_WM_LBUTTONUP()
ON_WM_CHAR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
Which 'Item' is my template variable but no progress. I even tested this
one:
BEGIN_MESSAGE_MAP(template<class Item> CMyListCtrl<Item>, CListCtrl)
//{{AFX_MSG_MAP(CMyListCtrl)
ON_NOTIFY_REFLECT(LVN_BEGINDRAG, OnBeginDrag)
ON_WM_LBUTTONUP()
ON_WM_CHAR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
Still not working!!!
Does anyone know how to map messages for a template class?
Regards,
Mehran Ziadloo
.
- Follow-Ups:
- Re: Message Mapping for a template class
- From: jiangsheng[MVP]
- Re: Message Mapping for a template class
- From: Tim Ward
- Re: Message Mapping for a template class
- Prev by Date: OnIdle and UI thread
- Next by Date: Converting String to Time
- Previous by thread: OnIdle and UI thread
- Next by thread: Re: Message Mapping for a template class
- Index(es):