Click here to Skip to main content
13,865,706 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


6 bookmarked
Posted 13 Feb 2018
Licenced CPOL

[VS2017] ListView Demonstration

, 13 Feb 2018
Rate this:
Please Sign up or sign in to vote.
Code attached to a 2003 article updated for Visual Studio 2017.


From the original 2003 article:

This article is for those who did not find, any useful code examples and information regarding ListControl (ListView). For me, it was really hard to get a working code for Win32 API, since I don't code in MFC. The only help I was able to get was win32.hlp which contains every API by Microsoft. Note that it did not have any examples in it. Also searching through forums can be helpful, but it is slow and sometimes you really wanna get some stuff going fast and clear. I decided to write this article for the coders who don't know any MFC (class) or just starting with ListControl via APIs. First, I must say that all examples I've seen so far lacked information for non-MFC coders!. If you can't code or can't understand MFC, and are using the API, then this little article is for you.

Attempting to build the code from the original article resulted in many errors, so the code from this tip/trick is aimed at getting the learner straight into the demonstration without delay.


Listviews are a useful piece of architecture today, just as much as they were fifteen years ago, and even back in the nineties, but besides the MSDN, there are very few instructive articles for the WinAPI approach - although this SO contribution might add to the picture as well.

Using the Code

Extract the attached source code to the current Visual Studio projects directory, open the sln file, and build the project. The project should also build without issue in VS2015. Please show appreciation of the Listview demonstration to Benji on his article page.

Points of Interest

The attachment to this tip/trick is based on the excellent 2003 article by Benji. The original article contains code and project settings which have been superseded by newer code and project settings in more recent versions of Visual Studio and C++. The debug build port is kept as close to the original as possible, and the ported executable performs as well as the original.

In building the project, VS 2017 loaded on double clicking listview.dsp in explorer, and the subsequent conversion to VS2017 format was seamless.

Of interest was an issue regarding the referenced afxres.h in the resource file listview.rsrc.rc. viz the logged APStudio Generated from the TEXTINCLUDE 2 resource message. This would pose no problem for VS2017 subscribers if they had already opted for the VS 1.25 Gb MFC libraries inclusion, but without MFC libraries the reference was manually removed with no deleterious effects in the attached build.


  • Version 1.0

Future versions will include 64 bit & Unicode samples.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Laurie Stearn
Australia Australia
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionToo late Pin
Merlin8714-Feb-18 4:06
memberMerlin8714-Feb-18 4:06 
QuestionCode Link is broken Pin
jeffie10013-Feb-18 17:49
memberjeffie10013-Feb-18 17:49 
AnswerRe: Code Link is broken Pin
Laurie Stearn13-Feb-18 18:05
memberLaurie Stearn13-Feb-18 18:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web02 | 2.8.190214.1 | Last Updated 13 Feb 2018
Article Copyright 2018 by Laurie Stearn
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid