Controls in CPaneDialog (MFC) not Working
-
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!
-
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!
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!
-
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!
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
-
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
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?
-
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!
5 years later I have the same problem! Have you found the solution?
-
5 years later I have the same problem! Have you found the solution?
You need to call at first the CPaneDialog::HandleInitDialog(wParam, lParam) to create all the Dialog members.