May 21st, 1999, 11:13 AM
Hi,
Can you help me solve this problem?
I have two dialogs. From the first dialog class, I create an instance of the second dialog and call DoModal() (this happens when user clicks a button).
The problem is that the first function called by MFC in the second dialog's class is DoDataExchange(), not OnInitDialog() ! The following ASSERT() fails :
HWND CDataExchange::PrepareCtrl(int nIDC)
{
ASSERT(nIDC != 0);
ASSERT(nIDC != -1); // not allowed
HWND hWndCtrl;
m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
if (hWndCtrl == NULL)
{
TRACE1("Error: no data exchange control with ID 0x%04X.\n", nIDC);
ASSERT(FALSE); //THIS ONE FAILS.
Then some of the OnChange....() message handlers are called, which is bizarre.
Does anybody know why OnInitDialog() isn't being called straight away ?
Thanks,
Gaz.
Can you help me solve this problem?
I have two dialogs. From the first dialog class, I create an instance of the second dialog and call DoModal() (this happens when user clicks a button).
The problem is that the first function called by MFC in the second dialog's class is DoDataExchange(), not OnInitDialog() ! The following ASSERT() fails :
HWND CDataExchange::PrepareCtrl(int nIDC)
{
ASSERT(nIDC != 0);
ASSERT(nIDC != -1); // not allowed
HWND hWndCtrl;
m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
if (hWndCtrl == NULL)
{
TRACE1("Error: no data exchange control with ID 0x%04X.\n", nIDC);
ASSERT(FALSE); //THIS ONE FAILS.
Then some of the OnChange....() message handlers are called, which is bizarre.
Does anybody know why OnInitDialog() isn't being called straight away ?
Thanks,
Gaz.