MFC App returns early after "Failed to create empty document dialogue". Debug output: No document names in string for template #(some number)

Posted on 2004-11-14
Last Modified: 2013-11-20

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 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(

      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.

      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.

Question by:actionjackson88
    LVL 55

    Expert Comment

    by:Jaime Olivares
    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"

    Author Comment

    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?
    LVL 55

    Accepted Solution

    IDR_MAINFRAME is the string identifier (without quotes please)
    string posted is the string content

    Author Comment

    thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
    Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now