Re: No response to ON_NOTIFY
Who know alot more info is need in order to find the problem. The obvoius
is make sure you are not setting the no sort header flag.
If that's not it then lets try this:
1.Start a new project.
2. Call SortListCtrlTest
3. Make it dialog base app.
4. open main dialog
5. remove the static control in middle of dialog
6. insert a list control
7. Change view flag from Icon to Report mode.
8. Write click on list control and click the Add Variable menu item
9. put m_MyListCtrl in Variable Name edit and press Enter
10. From Project Menu select Add Class
11. Select MFC Class from Template control on the right, and click Open
12. put CTestListCtrl in Class name, and change Base class to CListCtrl, and
click finish.
13. Now with CTestListCtrl showing in the property window, select the
Messages icon (the one that looks like window with a W in the middle)
14. Find LVN_COLUMNCLICK and expand the drop down to it's right and click
add.
(Step 13, and 14 can be done in dialog editor, right click on the ListCtrl
on your dialog, select Add event handler from the menu, find LVN_COLUMNCLICK
and press Add and Edit.)
15. Set a break point in CTestListCtrl::OnLvnColumnclick
16. open SortListCtrlTestDlg.h
17. Add #include "TestListCtrl.h" after #pragma once
18. Change m_MyListCtrl's type from CListCtrl to CTestListCtrl
19. Run the program
20. Click on header.
21. The break point will get hit.
AliR.
"ikinal" <ikinal@ieee.org> wrote in message
news:1190818252.792157.145420@k79g2000hse.googlegroups.com...
On Sep 25, 2:29 pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
Where are you putting that message map entry? In the list control
massage
map or the parent Dialog's message map?
AliR.
"ikinal" <iki...@ieee.org> wrote in message
news:1190740943.332634.134540@22g2000hsm.googlegroups.com...
Using the techiques in article
http://support.microsoft.com/?id=250614#top
"How to sort items in a ClistCtrl in ReportView", they state to
add to the message_map:
ON_NOTIFY(HDN_ITEMCLICK, 0, OnItemclickList1)
And then they give code for OnItemclickList1,
I've tried this, but the code is never called. ???
Do I need to add notification to the
parent to pass the mouse click?
I have a DIALOG application, running
under version 7.0.
Thanks,
Ihor- Hide quoted text -
- Show quoted text -
I have an outer APP file, and a Dialog file, where I'm doing all the
processing. [I create a ClistCtrl there] - and I do the message_maps
there.
A RELATED question, check the HELP on List-View Window Styles,
I found the following ...
LVS_NOSORTHEADER
Column headers do not work like buttons. This style can be used if
clicking a column header in report view does not carry out an action,
such as sorting.
Since I'm trying to achieve SORTHEADER, it seems this should WORK
by default -- why not ??
Here's my code:
CRect rect(16 ,60 ,450 ,250 );
m_PendListCtrl.Create(WS_VISIBLE|WS_CHILD|LVS_REPORT|
LVS_SORTASCENDING,
rect,this,IDD_WIRE_DIALOG);
m_PendListCtrl.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE,0,
LVS_EX_GRIDLINES|LVS_EX_FULLROWSELECT|
LVS_EX_HEADERDRAGDROP );
m_PendListCtrl.InsertColumn(0,"EXTID",LVCFMT_LEFT,75);
m_PendListCtrl.InsertColumn(1,"CUSTOMER",LVCFMT_LEFT,150);
m_PendListCtrl.InsertColumn(2,"AMOUNT",LVCFMT_RIGHT,85);
m_PendListCtrl.InsertColumn(3,"TRADE YPE",LVCFMT_LEFT,120);