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. Problem with CDialogBar e CTreeCtrl

Problem with CDialogBar e CTreeCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
data-structureshelpquestion
4 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I need to use a CTreeCtrl in a CDialogBar window but I have problems when I try to perform any operation in the tree control. All operation fails so I have found that the m_hWnd related to the TreeCtrl is 0x00000000. Does someone knows which is the problem ?? Can the CTreeCtrl be used in a CDialogBar ??

    R 1 Reply Last reply
    0
    • L Lost User

      I need to use a CTreeCtrl in a CDialogBar window but I have problems when I try to perform any operation in the tree control. All operation fails so I have found that the m_hWnd related to the TreeCtrl is 0x00000000. Does someone knows which is the problem ?? Can the CTreeCtrl be used in a CDialogBar ??

      R Offline
      R Offline
      Roman Fadeyev
      wrote on last edited by
      #2

      Anthiny B. wrote: Can the CTreeCtrl be used in a CDialogBar ?? Of course! 1) Check the block of code, which creates your TreeCtrl. What value is returned with Create function? What about GetLastError? 2) It may be a "race condition" - you might use a TreeCtrl when it has not been created yet. For example, it may be a WM_SIZE handler of your DialogBar

      A 1 Reply Last reply
      0
      • R Roman Fadeyev

        Anthiny B. wrote: Can the CTreeCtrl be used in a CDialogBar ?? Of course! 1) Check the block of code, which creates your TreeCtrl. What value is returned with Create function? What about GetLastError? 2) It may be a "race condition" - you might use a TreeCtrl when it has not been created yet. For example, it may be a WM_SIZE handler of your DialogBar

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        I don't create the TreeCtrl with the Create method !!! I have created a class derived from CDialogBar and I manage the TreeCtrl in that class using a CTreeCtrl member variable created through Class Wizard. I'm sure to don't use that variable before the window creation but I don not know how to verify the creation of the Tree control !!!:((

        R 1 Reply Last reply
        0
        • A Anonymous

          I don't create the TreeCtrl with the Create method !!! I have created a class derived from CDialogBar and I manage the TreeCtrl in that class using a CTreeCtrl member variable created through Class Wizard. I'm sure to don't use that variable before the window creation but I don not know how to verify the creation of the Tree control !!!:((

          R Offline
          R Offline
          Roman Fadeyev
          wrote on last edited by
          #4

          Override OnCreate (+OnInitDialog for guarantee) in your DialogBar. Set breakpoints at end of functions. Make sure that your TreeCtrl has been created (m_hWnd!=NULL). Just in case try to use GetDlgItem to obtain CTreeCtrl* pointer and check its m_hWnd. If ASSERT or exception raises earlier than you rich these breakpoints, you, it seems, have raise conditions Show us a fragment of code which refuses to run After all, try to rebuild all :)

          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