Getting the number of columns in the report view

To get the number of columns in the list view control, we first get a pointer to the header control and then use the header control to query the number of columns it has.
CHeaderCtrl* pHeader = (CHeaderCtrl*) m_listctrl.GetDlgItem(0);
int nColumnCount = pHeader->GetItemCount();
This works even when the listview control has the LVS_NOCOLUMNHEADER style. It also works if the control is not in the report view.


  • Trade Rumor : chanel Described as An Absolute Must This morning

    Posted by incockDak on 03/29/2013 08:03am

    This is why everyone is extremely wrong surrounding gucci and consequently reasons why you have to ought to see this ebook. [url=]バック[/url] Different questions about gucci clarified and reasons why you has got to read in detail each concept of this specific documentation. [url=]Sacs longchamp[/url] WuqGdqQheSqa [url=]nike ランニング[/url]ZtzJanPmaDop [[url=]nike free[/url]UbrPdlBbiClp [url=]ナイキスニーカー[/url]GqpUvrLhnEpo [url=]ナイキスニーカー[/url]LlpXkoBeoUqp [url=]nike スニーカー[/url]HxkKocIszLps [url=]ナイキゴルフ[/url]GfqAaqKcwKrt [url=]シューズナイキ[/url]ZkvTscAlfWns [url=]スニーカー アディダス[/url]DjqEynIeyEry

  • Just stop Complaining And Start your private nike shoes Distribution campaign Preferably

    Posted by expopmerm on 03/18/2013 01:54am

    The 12 MostWild adidas shoes Secrets and cheats... And The Way To Utilize them!!|Concise guide helps you with the ins and outs linked with nike shoes combined with things you want to undertake this afternoon.}[url=]nike air[/url] Understand who's preaching about nike shoes and exactly why you ought to get worried. [url=]スニーカー adidas[/url] adidas shoes will give spanking new life span to the old dilemma. . . defacto standard The way in which gucci bags Made Me Famous And Rich [url=]gucci バッグ[/url] The best tool for chloe which you may understand about right away. [url=]財布 chloe[/url] The Amazing chanel bags Hack Who Can Fool Almost all [url=]chanel バッグ[/url] Information on how to learn all the stuff there is to understand surrounding chanel in nine straight forward steps.The reasons why so many people are dead wrong regarding adidas shoes and as a result why you should certainly check this out post. [url=]adidas シューズ[/url] Whoa, amazing service. You must have a look at adidas shoes right now while it's still up for grabs ! ! [url=]nike running[/url] adidas shoes Counterfeits - A Really Wonderful nike shoes 'cheat' That experts claim Fools 97% of the customers

  • A valid pointer to CHeaderCtrl object

    Posted by Legacy on 11/26/2003 12:00am

    Originally posted by: Mirko

    Work with the windows handle of class CHeaderCtrl to retrieve a valid pointer if the header window exists.
    // The pointer to my list control.
    extern CListCtrl* pMyListControl;

    // ThePointer to my header control
    CHeaderCtrl* pHeader = NULL;

    HWND hwndList = 0;
    HWND hwndHeader = 0;

    hwndList = pMyListControl->GetSafeHwnd();
    hwndHeader = ListView_GetHeader(hwndList); //macro use
    pHeader = (CHeaderCtrl*)FromHandle(hwndHeader);
    int nColumnCount = pHeader->GetItemCount();

  • Use GetHeaderCtrl

    Posted by Legacy on 11/06/2001 12:00am

    Originally posted by: Joost van den Boom

    Instead of using "m_listctrl.GetDlgItem(0)" use "m_listctrl.GetHeaderCtrl()" then it works fine!


  • Wrong number of columns.

    Posted by Legacy on 05/17/2000 12:00am

    Originally posted by: Alon

    I used this code to find out the numbers of columns I have in order to delete them. I got wrong number and I made the deletion in that way:

    while(m_ListCtrl.DeleteColumn(0) != 0);

    In that way I didn't have any problem!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Moving from an on-premises environment to Office 365 does not remove the need to plan for disruptions or reduce the business risk requirements for protecting email services. If anything, some risks increase with a move to the cloud. Read how to ease the transition every business faces if considering or already migrating to cloud email. This white paper discusses: Setting expectations when migrating to Office 365 Understanding the implications of relying solely on Exchange Online security Necessary archiving …

  • Thanks to the Internet of Things (IoT), physical assets are turning into participants in real-time global digital markets. The countless types of assets around us will become as easily indexed, searched and traded as any online commodity. While some industries will be tougher to transform than others – those with physical limitations, such as manufacturing, will be harder to digitize – untold economic opportunities exist for growth and advancement. Our research shows this will create a new "Economy …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date