When I use
MFC as
Statically Linked Library, a Debug Assertion Failure message box containing the following code in my
app::InitInstance
appears:
generated debug assertion
if (!ProcessShellCommand(cmdInfo))
return FALSE;
-- File: docsingl.cpp
Line: 215
However when using
MFC as
Shared DLL, this error is not coming and I'll get my window.
I am confused to figure out why !?
I have traced out that my program is failing at the bolded line of the following code:
void CSingleDocTemplate::SetDefaultTitle(CDocument* pDocument)
{
CString strDocName;
if (!GetDocString(strDocName, CDocTemplate::docName) ||
strDocName.IsEmpty())
{
VERIFY(strDocName.LoadString(AFX_IDS_UNTITLED));
}
pDocument->SetTitle(strDocName);
}
If I use the
AFX_IDS_UNTITLED in the resource string table & everything went fine.
I don't want to do this.
Even if you don't use it in the string table, it should have worked fine. because
AFX_IDS_UNTITLED is defined in
afxres.h & the resource file uses this header file.
Other projects that do not use
AFX_IDS_UNTITLED in the string table resource are working fine.
So I opened the compiled
EXE file with a
Resource Editor, I searched for the missing string. I found that is was right there:
"sans nom" in
FRENCH cause I build my project with
FRENCH AppWizard.
I recreated my project using the
ENGLISH,
DEUTCH,
SPANISH &
ITALIC AppWizard, & figured out that the problem has gone.
& I thought that the problem is due to my system:
"Windows XP Pro SP3 FRENCH Edition", so I reinstalled the system that time:
"Windows XP Pro SP3 ENGLISH Edition", & figured out that all the problems has gone, & all the projects created using the
ENGLISH,
FRENCH,
DEUTCH,
SPANISH &
ITALIC AppWizard are working perfectly.
The problem is that I don't want to install
"Windows XP Pro SP3 ENGLISH Edition".
Any ideas? Help me
Please :((