المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to create a CMFCListView that would replace the CListView that currently is not a



C++ Programming
05-03-2009, 09:10 PM
New MFC is missing a CMFCListView class that would be able to use the new CMFCListCtrl. The reason for the attempt to use CMFCListCtrl is due to it's new header that does supports nice ordering and other stuff.

I followed the article from here (http://translate.google.com/translate?hl=en&sl=es&u=http://kithkanan-programacionencpp.blogspot.com/2008/07/cmfclistview-clistview-mejorado.html&ei=aMr9Sd2RM4_stgP0qOzSAQ&sa=X&oi=translate&resnum=1&ct=result&prev=/search%3Fq%3DCMFCListView%26hl%3Den%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26hs%3Dxpz%26num%3D50)[^ (http://translate.google.com/translate?hl=en&sl=es&u=http://kithkanan-programacionencpp.blogspot.com/2008/07/cmfclistview-clistview-mejorado.html&ei=aMr9Sd2RM4_stgP0qOzSAQ&sa=X&oi=translate&resnum=1&ct=result&prev=/search%3Fq%3DCMFCListView%26hl%3Den%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26hs%3Dxpz%26num%3D50)] but it looks like it doesn't work if you are using LVS_OWNERDATA.

I created a sample application using the wizard just for this test. There are 4 configuration you can build Debug,Release,Debug-New,Release-New - the ones with new will try to use CMFCListCtrl instead.

Some problems I saw are: the new CMFCListView is that it doesn't receive LVN_GETDISPINFO, the new header is not displayed but if you scroll it will show it. Any hints on this?

The project is located here: http://nusunt.eu/download/mfc/cmfclistview_test_1.zip[^ (http://nusunt.eu/download/mfc/cmfclistview_test_1.zip)] and to compile and test you need VC2008 SP1+FeaturePack.

Best regards,
Sorin Sbarnea