Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

[VS2017] ListView Demonstration

0.00/5 (No votes)
13 Feb 2018 1  
Code attached to a 2003 article updated for Visual Studio 2017.

Introduction

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.

Background

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.

History

  • Version 1.0

Future versions will include 64 bit & Unicode samples.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here