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(CExerciseView));
      AddDocTemplate(pDocTemplate);

      CCommandLineInfo cmdInfo;

      // Dispatch commands specified on the command line
      if (!ProcessShellCommand(cmdInfo))
            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.
actionjackson88Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jaime OlivaresSoftware ArchitectCommented:
You need to create a IDR_MAINFRAME string resource also. It is needed by CSingleDocTemplate, and is generated automatically when you use the AppWizard tool. Try to create a string like this:

"Exercise\n\nExercise\n\n\nExercise.Document\nExercise Document"
0
actionjackson88Author Commented:
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?
0
Jaime OlivaresSoftware ArchitectCommented:
IDR_MAINFRAME is the string identifier (without quotes please)
string posted is the string content
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
actionjackson88Author Commented:
thank you
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.