I have a Dialog resource and class in a DLL, and I'm having problems
displaying it from my main App using DoModal(). The DLL is an MFC DLL
and the target platform is Windows CE(but that shouldn't make a
difference).


I am getting an error,
"Assertion Failed! MyApp: File dlgcore.cpp, Line 504"

The dialog class starts with

class AFX_EXT_CLASS CMyDlg : public CDialog
{
}

and the function in my main App which calls DoModal starts with
AFX_MANAGE_STATE(AfxGetStaticModuleState());

eg,

void CMyAppView::OnButtonPress()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());

CMyDlg dlg;
dlg.DoModal();
}


Am i missing something ?

I've also tried
m_hInstDLL = LoadLibrary(_T("My.dll"));
AfxSetResourceHandle(m_hInstDLL);

and this didnt fix it either.

help would be much appreciated.
Regards
Woody.