Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

failure get a resource for a modeless dialog

19 views
Skip to first unread message

michael

unread,
Oct 5, 2004, 3:51:57 PM10/5/04
to
Can anyone help me?
 
 
    The following error occurs when I try to create a modeless Dialog:   "ERROR: Cannot find dialog template with IDD 0x%04X.\n".  
The problem occurs on the statement in blue. In addition,  I stepped into the dlgcore and determined that the  function
AfxCheckDialogtemplate()  can  not find the dialog resource.  I looked at the resource.h file and the macro IDD_ERRORDLG is
#defined as  133. I am creating "use MFC shared DLL's". 
 
 
ErrorBox.cpp

// create a CDialog Error Box

VERIFY(m_dlgError->Create(IDD_ERRORDLG, NULL));                                            //AfxGetMainWnd()));

if (!l_crRect.IsRectEmpty())

 m_dlgError->SetWindowPos(NULL, (l_crRect.TopLeft()).x, (l_crRect.TopLeft()).y,  0, 0, SWP_NOSIZE);

m_dlgError->ShowWindow(SW_SHOWNORMAL);

m_dlgError->UpdateWindow();

m_dlgError->SetFocus();
 
dlgcore.cpp

BOOL AFXAPI _AfxCheckDialogTemplate(LPCTSTR lpszResource, BOOL bInvisibleChild)

{

ASSERT(lpszResource != NULL);

HINSTANCE hInst = AfxFindResourceHandle(lpszResource, RT_DIALOG);

HRSRC hResource = ::FindResource(hInst, lpszResource, RT_DIALOG);

if (hResource == NULL)

{

if (DWORD_PTR(lpszResource) > 0xffff)

TRACE(traceAppMsg, 0, _T("ERROR: Cannot find dialog template named '%s'.\n"),

lpszResource);

else

TRACE(traceAppMsg, 0, "ERROR: Cannot find dialog template with IDD 0x%04X.\n",

LOWORD((DWORD_PTR)lpszResource));

return FALSE;

}

0 new messages