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. Controls in CPaneDialog (MFC) not Working

Controls in CPaneDialog (MFC) not Working

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestionlearning
6 Posts 5 Posters 3 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.
  • M Offline
    M Offline
    Member 8534035
    wrote on last edited by
    #1

    Hello, I am tryint to use CPaneDialog for implementing dockable Dialogs, based on a Dialog resource. I started with the GestureDemo from Microsoft's MFC samples. There is an option dialog bases on CPaneDialog. The demo works as it is. I added to the dialog resource a ListControl. Here is my problem. The Control is not displaying any content! I tested the same dialog inside a standard CDialog. So actually my control works fine! Is there anything additionally, I need to do in a CPaneDialog to interact with dialog controls? Unfortunately I cannot find further source code samples. Seems, nobody is using CPaneDialog. Any hints? Thanks a lot!

    V D C 3 Replies Last reply
    0
    • M Member 8534035

      Hello, I am tryint to use CPaneDialog for implementing dockable Dialogs, based on a Dialog resource. I started with the GestureDemo from Microsoft's MFC samples. There is an option dialog bases on CPaneDialog. The demo works as it is. I added to the dialog resource a ListControl. Here is my problem. The Control is not displaying any content! I tested the same dialog inside a standard CDialog. So actually my control works fine! Is there anything additionally, I need to do in a CPaneDialog to interact with dialog controls? Unfortunately I cannot find further source code samples. Seems, nobody is using CPaneDialog. Any hints? Thanks a lot!

      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      How do you create the dialog? How do you initialize the list control? PS: sorry, I do not have the MFC samples installed on my PC, so I cannot test it myself!

      1 Reply Last reply
      0
      • M Member 8534035

        Hello, I am tryint to use CPaneDialog for implementing dockable Dialogs, based on a Dialog resource. I started with the GestureDemo from Microsoft's MFC samples. There is an option dialog bases on CPaneDialog. The demo works as it is. I added to the dialog resource a ListControl. Here is my problem. The Control is not displaying any content! I tested the same dialog inside a standard CDialog. So actually my control works fine! Is there anything additionally, I need to do in a CPaneDialog to interact with dialog controls? Unfortunately I cannot find further source code samples. Seems, nobody is using CPaneDialog. Any hints? Thanks a lot!

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Member 8534035 wrote:

        Here is my problem. The Control is not displaying any content!

        How are you adding content? Where?

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        M 1 Reply Last reply
        0
        • D David Crow

          Member 8534035 wrote:

          Here is my problem. The Control is not displaying any content!

          How are you adding content? Where?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

          M Offline
          M Offline
          Member 8534035
          wrote on last edited by
          #4

          sorry for the late reply...I was absent a while! in the meantime I lost my first trail project and did it again, somehow differently ;) but it is still not working! My steps in detail: 1. Using the original source code from VS Gesture Demo 2. Adding a ListControl to the IDD_OPTIONS Dialog resource (report style) ID: IDC_LIST_INPANE 3. doing the same what the framework would do automatically for a standard dialog: - in OptionPane.h I added

          CListCtrl m_ListCtrl;

          - in OptionPane.cpp in DoDataExchange

          DDX_Control(pDX, IDC_LIST_INPANE, m_ListCtrl);

          4. Added a Handler for WM_INITDIALOG

          LRESULT COptionsPane::HandleInitDialog(WPARAM wParam,LPARAM lParam)
          {
          UNREFERENCED_PARAMETER(wParam);
          UNREFERENCED_PARAMETER(lParam);

          m_ListCtrl.InsertColumn(0,_T("Col1"),LVCFMT_LEFT,50);
          m_ListCtrl.InsertColumn(1,_T("Col2"),LVCFMT_LEFT,50);

          int nItem;
          nItem = m_ListCtrl.InsertItem(MAXINT,_T("Item1"));

          that's quite all! Now, when I am starting the program, I will get an assertion in HandleInitDialog at the first access of m_ListCtrl. It seems m_hWnd is not valid at this moment. What I need to do additionally in comparison to CDialog (where I initialize the control in OnInitDialog()) Is CPaneDialog::HandleInitDialog the wrong place for initialization of controls?

          1 Reply Last reply
          0
          • M Member 8534035

            Hello, I am tryint to use CPaneDialog for implementing dockable Dialogs, based on a Dialog resource. I started with the GestureDemo from Microsoft's MFC samples. There is an option dialog bases on CPaneDialog. The demo works as it is. I added to the dialog resource a ListControl. Here is my problem. The Control is not displaying any content! I tested the same dialog inside a standard CDialog. So actually my control works fine! Is there anything additionally, I need to do in a CPaneDialog to interact with dialog controls? Unfortunately I cannot find further source code samples. Seems, nobody is using CPaneDialog. Any hints? Thanks a lot!

            C Offline
            C Offline
            Couvert Gerard
            wrote on last edited by
            #5

            5 years later I have the same problem! Have you found the solution?

            K 1 Reply Last reply
            0
            • C Couvert Gerard

              5 years later I have the same problem! Have you found the solution?

              K Offline
              K Offline
              Klaus Bucher
              wrote on last edited by
              #6

              You need to call at first the CPaneDialog::HandleInitDialog(wParam, lParam) to create all the Dialog members.

              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