Search code examples
mfcmfc-feature-pack

How to use CMFCListCtrl with CListView?


I'd like to use the new CMFCListCtrl features with my CListView class (and, of course, the new CMFCHeaderCtrl inside it). Unfortunately, you can't use Attach() or SubclassWindow() because the SysListView32 window is already associated with a CListView object.

Do I have to override CListView's OnCmdMsg() and route all messages to my own instance of CMFCListCtrl? (Will that even work?) Or is there an easier/cleaner solution?


Solution

  • I'd inherit from CFormView and let the CMFCListCtrl occupy the complete dialog of the form view.