LVN_GETDISPINFO with CListCtrl in a Dialog
David Doughty -- dave_doughty@MENTORG.COM
Tuesday, May 21, 1996
VC++4.1 / Win '95
Problem: The contents of an ownerdraw CListCtrl are not being displayed.
Background:
The CListCtrl is in a dialog which is mapped to one of the pages in my
sheet. The resource has it set for ownerdrawfixed as well as report mode.
In the OnInitDialog I cause the list control to be populated. Each LV_ITEM
added has the pszText set equal to LPSTR_TEXTCALLBACK. I have attempted to
use ON_NOTIFY_REFLECT to capture the LVN_GETDISPINFO messages in the
CListCtrl.
I have used spy++ to verify that the CListCtrl is populated. I have also
used it to look at the WM_NOTIFY messages for the process. There are no
LVN_GETDISPINFO messages being sent. I am thinking this is the problem but
I can't understand why.
Any advice would be greatly appreciated.
Dave
Mario Contestabile -- Mario_Contestabile.UOS__MTL@UOSMTL2.universal.com
Tuesday, May 28, 1996
[Mini-digest: 3 responses]
>VC++4.1 / Win '95
>Problem: The contents of an ownerdraw CListCtrl are not being displayed.
Check out the Rowlist example on the 4.1 CD-ROM for a comprehensive
example (it uses CListView).
mcontest@universal.com
-----From: dobrin@itls.com
Try to open the Properties for your dialog box. For the list control,
set the type to report, at the beginning, and the sorting order to
NONE. This happened to me and it worked.
How you get an item later from a list control in a dialog box, would
be very interesting to find out. If you have a list view derived from
a CListCtrl, it is crystal clear, but not more then that.
Regards,
Dan Dobrin
dan.dobrin@itls.com
-----From: "Frederic Steppe"
Maybe (just maybe) this is the list control drawing routine which sends the
LVN_GETDISPINFO notification. In that case, as you have to draw items
yourself, you should send the notification to the control from within your
WM_DRAWITEM override.
Frederic Steppe (frederics@msn.com)
| Вернуться в корень Архива
|