Note that there are some explanatory texts on larger screens.

plurals
  1. POSubdialog's hWnd resets to NULL after the dialog is initialized
    primarykey
    data
    text
    <p>I have stuck with the following problem. I have a main dialog that has some controls. It also displays several subdialogs (as subcontrols) that are set as a pointer members with their <code>ID</code>s. I create these dialogs with their <code>ID</code>s via <code>CreateControl</code> during <code>OnInitDialog</code>. Yesterday it <b>worked very well</b>. Today, I decided to add some controls to subdialogs and caught a problem.</p> <p>That's how I create subdialogs in the main dialog durig <code>OnInitDialog</code>:</p> <pre><code>if (m_pNewObjDlg != NULL) m_pNewObjDlg-&gt;Create(m_nNewObjDlgID, this); if (m_pSharedObjDlg != NULL) m_pSharedObjDlg-&gt;Create(m_nSharedObjDlgID, this); </code></pre> <p>That's how I set the subdialogs outside from one of my routines:</p> <pre><code>dlgSelectSharedObject.SetNewPageObject(&amp;dlgSelectNewTableDialog, CSelectNewTableDialog::IDD); dlgSelectSharedObject.SetSharedPageObject(&amp;dlgSelectSharedTable, CSelectSharedTableDialog::IDD); </code></pre> <p>I see that <code>OnInitDialog</code> and <code>DoDataExchange</code> of the two subdialogs work well, subdialogs' <code>m_hWnd</code>s are set, <code>GetDlgItem</code> methods return valid values. But when the execution comes back to main dialog's <code>OnInitDialog</code> I see that <code>m_hWnd</code> values of <code>pNewObjDlg</code> and <code>pSharedObjDlg</code> are <code>NULL</code>. I don't know how that could happen. I double checked the <code>ID</code>s, they don't overlap. As a result I get an <code>ASSERT</code> with nothing displayed except main dialog with its controls. Just any thoughts?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload