Nikola Gaić
Nikola Gaić

Reputation: 127

Is it possible to use CListCtrl without MFC

I would like to use CListCtrl in my Win32 project. I have tried to add MFC to my project but I have failed. I only need CListCtrl. Can I somehow add only CListCtrl without whole MFC.

Upvotes: 1

Views: 557

Answers (2)

marcinj
marcinj

Reputation: 50026

The CListCtrl class is just a wrapper around a standard Win32 ListView control, which you can use without MFC. The MFC sources are available in this source path:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc

For coding a ListView without MFC, see the ListView documentation.

Or you might consider using another library, such as WTL.

Upvotes: 4

Ajay
Ajay

Reputation: 18431

You'll need to use appropriate function or method to change list-control's behavior so that multiple columns are shown. Use CListCtrl::SetView with LV_VIEW_DETAILS.

You may also use LVM_SETVIEW with the same value.

If you are using dialog editor of Visual Studio (MFC or Win32), you simply need to change View property.

Upvotes: 1

Related Questions