actionjackson88
asked on
MFC App returns early after "Failed to create empty document dialogue". Debug output: No document names in string for template #(some number)
Hi,
I am using Visual C++ 6.0 and following a tutorial to create a simple Single Document Interface application (the URL for the section of the tutorial from which I am currently at is http://www.functionx.com/MFCFundamentals/Lesson05.htm). Following the instructions at that page, I created two resources - a menu and an icon and named them both IDR_MAINFRAME. I saved the script (and of course the corresponding resource header file was automatically generated).
However each time I launch the app, I get a "Failed to create empty document dialogue". When I debug, on the output pane I get the message:
Warning: no document names in string for template #101.
Warning: no document names in string for template #101.
Warning: failed to load menu for CFrameWnd.
Warning: CDocTemplate couldn't create a frame.
The InitInstance function of my code looks like this
BOOL CExerciseApp::InitInstance ()
{
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CExerciseDoc ),
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CExerciseVie w));
AddDocTemplate(pDocTemplat e);
CCommandLineInfo cmdInfo;
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdI nfo))
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_ SHOW);
m_pMainWnd->UpdateWindow() ;
return TRUE;
}
I found a similar query on experts-exchange and one of the experts recommended creating a string table and making entries for the the template number IDs with any caption. However this has not solved the problem in my case.
Thanks.
I am using Visual C++ 6.0 and following a tutorial to create a simple Single Document Interface application (the URL for the section of the tutorial from which I am currently at is http://www.functionx.com/MFCFundamentals/Lesson05.htm). Following the instructions at that page, I created two resources - a menu and an icon and named them both IDR_MAINFRAME. I saved the script (and of course the corresponding resource header file was automatically generated).
However each time I launch the app, I get a "Failed to create empty document dialogue". When I debug, on the output pane I get the message:
Warning: no document names in string for template #101.
Warning: no document names in string for template #101.
Warning: failed to load menu for CFrameWnd.
Warning: CDocTemplate couldn't create a frame.
The InitInstance function of my code looks like this
BOOL CExerciseApp::InitInstance
{
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CExerciseDoc
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CExerciseVie
AddDocTemplate(pDocTemplat
CCommandLineInfo cmdInfo;
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdI
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_
m_pMainWnd->UpdateWindow()
return TRUE;
}
I found a similar query on experts-exchange and one of the experts recommended creating a string table and making entries for the the template number IDs with any caption. However this has not solved the problem in my case.
Thanks.
ASKER
hi, thanks for the advice.
please forgive my ignorance, but exactly how do i do this?
do i put this string resource in the string table and use that string you wrote as a caption?
please forgive my ignorance, but exactly how do i do this?
do i put this string resource in the string table and use that string you wrote as a caption?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you
"Exercise\n\nExercise\n\n\