Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to use CMFCListCtrl

1,094 views
Skip to first unread message

Schultz@discussions.microsoft.com Nick Schultz

unread,
Apr 18, 2008, 6:56:01 PM4/18/08
to
First off, I am new to programming for MFC, let alone Windows. I'm a Senior
in college in CS, and have a decent grasp on programming concepts. So please
bear with me if I make any crazy assumptions :)

I am trying to make an application that essentially lists messages that get
streamed into the system. So I am wanting the main view to be a CListCtrl,
however I also want some of the added functionality of the new MFC feature
pack's CMFCListCtrl, however I'm not sure how to use it and cannot find any
tutorials or examples that use it. My app's main view is a CListView, and
that seems to only give you access to a CListCtrl. So I guess, my question
is how do I use CMFCListCtrl with a CListCtrl?

Thanks,
Nick

Tom Serface

unread,
Apr 18, 2008, 7:11:24 PM4/18/08
to
You would use a CMFCListCtrl instead of a CListCtrl. This demo that you can
download has that control in it. Maybe that would help you get started:

http://msdn2.microsoft.com/en-us/library/bb983983.aspx

Tom

"Nick Schultz" <Nick Sch...@discussions.microsoft.com> wrote in message
news:33113DA5-8D3F-4DE7...@microsoft.com...

Nick Schultz

unread,
Apr 18, 2008, 7:26:00 PM4/18/08
to
I have to use a CListView right? CListView::GetListCtrl returns a reference
to a CListCtrl... I don't believe there is a CMFCListView that returns a
reference to a CMFCListCntrl. Am I going to have to create my own class that
inherits from CCtrlView that will use CMFCListCtrl?

Nick Schultz

unread,
Apr 18, 2008, 7:35:00 PM4/18/08
to

Sorry, my question should have been:


"how do I use CMFCListCtrl with a CListView?" (Not CListCtrl)

Tom Serface

unread,
Apr 18, 2008, 8:35:04 PM4/18/08
to
You are correct. There is not a CMFCListView. You could create your own
view with an embedded list control or you could just use a CFormView with a
CMFCListCtrl taking up the whole real estate of the dialog. I think using a
CFormView would be a lot easier. You could just resize the list control at
run time to fill the whole view if you wanted.

Tom

"Nick Schultz" <NickS...@discussions.microsoft.com> wrote in message
news:05FA8126-92CC-44CC...@microsoft.com...

Tom Serface

unread,
Apr 18, 2008, 8:42:52 PM4/18/08
to
Yeah, I sort of answered that in the other post, but I looked again and I
did not see a CMFCListView (just Ctrl) so you'll have to either derive your
own class or just use the form view idea I mentioned. I'm not sure I see a
huge benefit in using the CMFCListCtrl over a CListView or CListCtrl unless
you want to use the built in sorting capabilities or coloring stuff. If you
don't need this it may be easier to just use a traditional CListView.

Tom

"Nick Schultz" <NickS...@discussions.microsoft.com> wrote in message

news:E9A57506-C30C-486B...@microsoft.com...

0 new messages