Confusion in using ON_NOTIFY and ON_NOTIFY_REFLECT messages.

Hai All,

I'm reading this article:
http://www.codeproject.com/listctrl/lvcustomdraw.asp

Actually I want to draw background of specific row in CListView (Report Form)

Mine is a MDI application.
I derived a class from CListView.

After reading this article, I found that I cant use ON_NOTIFY because to this I have to pass ID of the ListControl.
But I'm using a class which is derived from CListView.

Ex: ON_NOTIFY ( NM_CUSTOMDRAW, IDC_MY_LIST, OnCustomdrawMyList )

So other option remained is to use ON_NOTIFY_REFLECT, but my problem is, in the ClassView I right clicked on the Class which is derived from CListView.
And tried to handle ON_NOTIFY_REFLECT, but to my surprise, I did not find ON_NOTIFY_REFLECT, but virtual function OnNotify is there.

Ex: ON_NOTIFY_REFLECT ( NM_CUSTOMDRAW, OnCustomdraw )

Please help me out!!!!!
[929 byte] By [Anshin] at [2007-11-19 1:48:03]
# 1 Re: Confusion in using ON_NOTIFY and ON_NOTIFY_REFLECT messages.
Please answer this query!!!
Thanks
Anshin at 2007-11-11 0:50:28 >
# 2 Re: Confusion in using ON_NOTIFY and ON_NOTIFY_REFLECT messages.
Add it manually. The CLW is just a helper tool, it does not have everything in there.
panayotisk at 2007-11-11 0:51:28 >
# 3 Re: Confusion in using ON_NOTIFY and ON_NOTIFY_REFLECT messages.
Is it? Thanks panayotisk!!!
I will try.
Anshin at 2007-11-11 0:52:27 >
# 4 Re: Confusion in using ON_NOTIFY and ON_NOTIFY_REFLECT messages.
From MSDN:

To define a message handler for a reflected message with ClassWizard in ClassWizard, click the Message Maps tab.

From the Class name drop-down list, select the name of your control class.

In the Object IDs box, select the name of your control class.

In the Messages box, select the message for which you want to define a handler. Your class's reflected messages are marked with an equal sign (=).
A message with a handler already defined is displayed in bold.
Tip Selecting a message displays a brief description of it at the bottom of the MFC ClassWizard dialog box.
Click Add Function (or double-click the message name).
For messages that do not already have a predefined name for the handler function, the Add Member Function dialog box appears.
Click OK to accept the proposed name.
ClassWizard reappears. The message name is displayed in bold to show that a message handler is defined. The name of the new message hander appears in the Member functions box.
At this point you have several options. You can:
Click Cancel to avoid updating your source code with the selected member functions.
Add more message handlers.

Click OK to automatically update your source code with selected member functions and close ClassWizard. You can return to ClassWizard any time during the development process.

Click Edit Code to jump to the empty function body just created by ClassWizard and begin defining the function's behavior.
When you click OK or Edit Code, ClassWizard updates your source code as follows:

A function declaration is inserted into the header file.

A complete, correct function definition with a skeletal implementation is inserted into the implementation file.

The class's message map is updated to include the new message-handling function.
panayotisk at 2007-11-11 0:53:24 >
# 5 Re: Confusion in using ON_NOTIFY and ON_NOTIFY_REFLECT messages.
But I'm using a class which is derived from CListView.
NM_CUSTOMDRAW does not exist in class wizard database (I think VS 6 was released before IE 3).

Just pick up any NM_*** reflection message (=NM_CLICK for example) and insert handler. Change NM_CLICK to NM_CUSTOMDRAW afterwards.
JohnCz at 2007-11-11 0:54:34 >
# 6 Re: Confusion in using ON_NOTIFY and ON_NOTIFY_REFLECT messages.
Ok John, Thanks.
Anshin at 2007-11-11 0:55:25 >