Art Schumer
April 24th, 1999, 07:06 AM
Configuration: P400, NT 4.0Sp4 Workstation, VC6.0
I have a dialog that is common to two programs located in a DLL that I wrote. When I run one program it brings up the dialog just fine. When I run the other, I get an ASSERT within the MFC code CDataExchange::PrepareCtrl. It claims there isn't a data exchange control with an ID of 2020 (my first control in the dialog). I thought maybe the DLL's resource map was not hooked up the application properly however other dialogs in the DLL come up just fine in both programs.
The code to call up the dialog is identical between the two program as follows:
void CMainFrame::OnSetngsWorkerDB()
{
CWorkerDBDlg wrkrDlg;
wrkrDlg.DoModal();
}
Can anyone give me some help tracking this down? This baffles the &*^&%^ out of me!
thx, Art
=========================================
MFC code in dlgdata.cpp
=========================================
HWND CDataExchange::PrepareCtrl(int nIDC)
{
ASSERT(nIDC != 0);
ASSERT(nIDC != -1); // not allowed
HWND hWndCtrl;
m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
if (hWndCtrl == NULL)
{
***>>> DIES HERE <<<***
TRACE1("Error: no data exchange control with ID 0x%04X.\n", nIDC);
ASSERT(FALSE);
AfxThrowNotSupportedException();
}
m_hWndLastControl = hWndCtrl;
m_bEditLastControl = FALSE; // not an edit item by default
ASSERT(hWndCtrl != NULL); // never return NULL handle
return hWndCtrl;
}
Art Schumer
Evergreen Software, Inc.
<mailto: Art.Schumer@WorldNet.Att.Net>
I have a dialog that is common to two programs located in a DLL that I wrote. When I run one program it brings up the dialog just fine. When I run the other, I get an ASSERT within the MFC code CDataExchange::PrepareCtrl. It claims there isn't a data exchange control with an ID of 2020 (my first control in the dialog). I thought maybe the DLL's resource map was not hooked up the application properly however other dialogs in the DLL come up just fine in both programs.
The code to call up the dialog is identical between the two program as follows:
void CMainFrame::OnSetngsWorkerDB()
{
CWorkerDBDlg wrkrDlg;
wrkrDlg.DoModal();
}
Can anyone give me some help tracking this down? This baffles the &*^&%^ out of me!
thx, Art
=========================================
MFC code in dlgdata.cpp
=========================================
HWND CDataExchange::PrepareCtrl(int nIDC)
{
ASSERT(nIDC != 0);
ASSERT(nIDC != -1); // not allowed
HWND hWndCtrl;
m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
if (hWndCtrl == NULL)
{
***>>> DIES HERE <<<***
TRACE1("Error: no data exchange control with ID 0x%04X.\n", nIDC);
ASSERT(FALSE);
AfxThrowNotSupportedException();
}
m_hWndLastControl = hWndCtrl;
m_bEditLastControl = FALSE; // not an edit item by default
ASSERT(hWndCtrl != NULL); // never return NULL handle
return hWndCtrl;
}
Art Schumer
Evergreen Software, Inc.
<mailto: Art.Schumer@WorldNet.Att.Net>