Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Why CListView do not inherit from CListCtrl

Why CListView do not inherit from CListCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
cssquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    white jungle
    wrote on last edited by
    #1

    I wrote some useful code in my class Class CMyListCtrl:public CListCtrl And now,I want to use these code in my new class CMyListView. Originally,I want to inherit CMyListView from CMyListCtrl. But I found that ListView do not inherit from ListCtrl. So how can I use my own code for CMyListView with less modification! Thanks a lot! Don't look at me in that way!

    Y S 2 Replies Last reply
    0
    • W white jungle

      I wrote some useful code in my class Class CMyListCtrl:public CListCtrl And now,I want to use these code in my new class CMyListView. Originally,I want to inherit CMyListView from CMyListCtrl. But I found that ListView do not inherit from ListCtrl. So how can I use my own code for CMyListView with less modification! Thanks a lot! Don't look at me in that way!

      Y Offline
      Y Offline
      YaronNir
      wrote on last edited by
      #2

      CListView inherites from CCtrlView and eventually from CView in order to keep the documnet/view architecture whilst using a list view within your app.... in order to use your CMyListCtrl in a CListView i suggest embedding...i.e. embedd one in an other class CMyListView : public CView { protected: CMyListCtrl* m_pMyList; } hope this helps Yaron Ask not what your application can do for you, Ask what you can do for your application

      1 Reply Last reply
      0
      • W white jungle

        I wrote some useful code in my class Class CMyListCtrl:public CListCtrl And now,I want to use these code in my new class CMyListView. Originally,I want to inherit CMyListView from CMyListCtrl. But I found that ListView do not inherit from ListCtrl. So how can I use my own code for CMyListView with less modification! Thanks a lot! Don't look at me in that way!

        S Offline
        S Offline
        Sheng Jiang
        wrote on last edited by
        #3

        you can use templates. See the source of CHTMLEditView and CHTMLEditCtrl. My blogs: http://blog.joycode.com/jiangsheng http://blog.csdn.net/jiangsheng http://bloglines.com/public/jiangsheng Command what is yours Conquer what is not ---Kane -- modified at 1:24 Tuesday 15th November, 2005

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups