views:

165

answers:

1

I have an MFC dialog based application created inside Visual Studio 2008.

CCalendarWindowDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();

When I run the application, DoModal() asserts at very first line

INT_PTR CDialog::DoModal()
{
    // can be constructed with a resource template or InitModalIndirect
    ASSERT(m_lpszTemplateName != NULL || m_hDialogTemplate != NULL ||
    m_lpDialogTemplate != NULL);
}

Can anyone please help?

A: 

Seems like the resource template is missing or wrongly mapped.

Look at the IDD attribute at your CCalendarWindowDlg class and see whether you have the appropriate dialog present in the Resource View.

Are you using the satellite DLLs for localization or other purpose? or the CCalendarWindowDlg component resource DLL might be missing.

Gopalakrishnan Subramani
Thanks Gopalakrishnan for your prompt reply.But I have checked the IDD attribute and it matches with the one in "resource.h" and "CalendarWindow.rc".What else can I do?
you can see whether CCalenderWindowDlg uses a satellite DLL
Gopalakrishnan Subramani