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.
 



Comments

  • 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=http://growth-management.alachua.fl.us/comprehensive_planning/gucci.html]バック[/url] Different questions about gucci clarified and reasons why you has got to read in detail each concept of this specific documentation. [url=http://growth-management.alachua.fl.us/comprehensive_planning/saclongchamp.php]Sacs longchamp[/url] WuqGdqQheSqa [url=http://running-nike0.seesaa.net/]nike ランニング[/url]ZtzJanPmaDop [[url=http://free-nike-nikeo.seesaa.net/]nike free[/url]UbrPdlBbiClp [url=http://xn--nike-ul4c5c5fyqb.seesaa.net/]ナイキスニーカー[/url]GqpUvrLhnEpo [url=http://nikejapan0.seesaa.net/]ナイキスニーカー[/url]LlpXkoBeoUqp [url=http://nikesneakersjp.seesaa.net/]nike スニーカー[/url]HxkKocIszLps [url=http://nikegolf00.seesaa.net/]ナイキゴルフ[/url]GfqAaqKcwKrt [url=http://nikeshoes00.seesaa.net/]シューズナイキ[/url]ZkvTscAlfWns [url=http://sneaker-adidas-jp.seesaa.net/]スニーカー アディダス[/url]DjqEynIeyEry

    Reply
  • 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=http://www.nikejapan.asia/]nike air[/url] Understand who's preaching about nike shoes and exactly why you ought to get worried. [url=http://www.adidasjapan.biz/]スニーカー 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=http://www.guccijp.asia/]gucci バッグ[/url] The best tool for chloe which you may understand about right away. [url=http://www.chloejp.biz/]財布 chloe[/url] The Amazing chanel bags Hack Who Can Fool Almost all [url=http://www.chaneljp.biz/]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=http://www.adidasjapan.asia/]adidas シューズ[/url] Whoa, amazing service. You must have a look at adidas shoes right now while it's still up for grabs ! ! [url=http://www.nikejp.biz/]nike running[/url] adidas shoes Counterfeits - A Really Wonderful nike shoes 'cheat' That experts claim Fools 97% of the customers

    Reply
  • 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);
    if(pHeader)
    int nColumnCount = pHeader->GetItemCount();

    Reply
  • 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!

    Joost

    Reply
  • 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!

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

Top White Papers and Webcasts

  • You've managed to piece together the "DREAM TEAM." Your tech staff works like a well-oiled machine, keeping your company humming and thriving. And then it happens: dissension. For whatever reason, your employees have grown unhappy and you find out they're searching for new employment or losing productivity. What did you do wrong? Did you hire the wrong people? Did your company push them away? Or is it a combination of numerous factors? Read this white paper to learn how to build an environment that fosters …

  • Whether you're just now developing your first mobile app, refining an existing one, or deploying multiple apps, the process for doing so can be complicated. Utilizing a Rapid Mobile Application Development (RMAD) platform can help you not only make that process easier, but also help the business reach its goals in a timely, cost-efficient manner. This eBook outlines seven key factors to consider as you choose the right RMAD platform to meet your needs, and includes a quick-reference checklist.

Most Popular Programming Stories

More for Developers

RSS Feeds

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