Microsoft KB Archive/129095

= Description of the format of the document template string =

Article ID: 129095

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 1.0 Professional Edition

 Microsoft Visual C++ 1.5 Professional Edition

 Microsoft Visual C++ 1.51

 Microsoft Visual C++ 1.52 Professional Edition</li></ul>

 Microsoft Visual C++ 1.0 Professional Edition</li></ul>

 Microsoft Visual C++ 2.0 Professional Edition</li></ul>

 Microsoft Visual C++ 2.1</li></ul>

 Microsoft Visual C++ 4.0 Standard Edition</li></ul>

 Microsoft Visual C++ 4.1 Subscription</li></ul>

 Microsoft Visual C++ 4.2 Enterprise Edition</li></ul>

 Microsoft Visual C++ 5.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 6.0 Enterprise Edition</li></ul>

<ul> <li>Microsoft Visual C++ 4.2 Professional Edition</li></ul>

<ul> <li>Microsoft Visual C++ 5.0 Professional Edition</li></ul>

<ul> <li>Microsoft Visual C++ 6.0 Professional Edition</li></ul>

<ul> <li>Microsoft Visual C++ 6.0 Standard Edition</li></ul>

<ul> <li>Microsoft Visual C++ .NET 2003 Standard Edition</li></ul>

<ul> <li>Microsoft Visual C++ .NET 2002 Standard Edition</li></ul>

<ul> <li>Microsoft Visual C++ 2005 Express Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q129095

<div class="summary_section">

SUMMARY
This article explains the format of the document template string.

<div class="moreinformation_section">

MORE INFORMATION
The document template string is a string resource consisting of up to nine Sub-strings separated by the \n character. Each sub-string contains information specific to the document template. The document template string is contained in the document template and can be edited by the Resource Editor (AppStudio).

Format of the Document Template String
NOTE: If a sub-string is not wanted and therefore not included in the complete document template string, you must still use the \n character as a delimiter. However, trailing \n characters are not necessary. IDR_MAINFRAME <windowTitle>\n<docName>\n<fileNewName>\n <filterName>\n <filterExt>\n<regFileTypeID>\n <regFileTypeName>\n <filterMacExt(filterWinExt)>\n <filterMacName(filterWinName)> The following table defines each of the substrings:

The final two sub-strings are defined conditionally. When _MAC is defined, the sub-strings are assigned to <filterName> and <filterExt>, while the two sub-strings that normally have these names are defined as <filterWinName> and <filterWinExt>. When _MAC is not defined, the two new sub-strings are assigned the names <filterMacName> and <filterMacExt>.

These last two sub-strings allow references to filename extensions to be removed from filterName and allow the four-character Macintosh file type for your application to be specified in filterExt.

Example
This example is the document template string used in the Scribble step 4 example provided with Visual C++, version 2.1 and later.

NOTE: _MAC is not defined. Also, the first sub-string is not used in MDI applications. Therefore, a document template string for an MDI application begins with the \n character. IDR_SCRIBTYPE \nScrib\nScrib\nScrib Files (*.scr)\n.SCR \nScribble.Document.1\nScrib Document \nSCRI\nscri Files

<windowTitle>     Not used due to MDI application. <docName>         Scrib <fileNewName>     Scrib <filterName>      Scrib Files (*.scr) <filterExt>       .SCR <regFileTypeId>   Scribble.Document.1 <regFileTypeName> Scrib Document <filterMacExt>    SCRI <filterMacName>   scri Files

Platform Differences
The string resource is parsed into the following sub-strings based on the platform:

Win32
NOTE: The last two are not documented in Visual C++ 5.0.

Win32 Mac
<div class="references_section">