IDR_MAINFRAME的含义

王朝vc·作者佚名  2006-01-09
宽屏版  字体: |||超大  

msdn上摘录出来的,没来得及翻译,以后再说

The document string is a string resource formed from a combination of up to seven substrings separated by \n characters, each of which describes one characteristic of the frame window or document associated with the document template. In left-to-right order, the substrings specify:

The name that will appear in the frame window's caption bar (SDI applications only). This is usually the name of the application-for example, "Microsoft Draw."

The default name assigned to new documents. If this substring is omitted, the default is "Untitled."

A descriptive name for the document type that appears along with other document types in a dialog box when the user selects New from the File menu-for example, "Spreadsheet" or "Drawing." This entry is only needed in MDI applications that register two or more document types.

A descriptive name for documents of this type combined with the default file name extension-for example, "Draw files (*.DRW)." This string is used in the file-type field of the Open and Save As dialog boxes.

The default file name extension for documents of this type-for example, DRW.

A name with no spaces that identifies the document type in the registry-for example, "MicrosoftDraw.Document." If an application calls CWinApp::RegisterShellFileTypes to register its document type(s), this substring becomes the default value for the HKEY_CLASSES_ROOT subkey named after the document's file name extension.

A descriptive name for the document type-for example, "Microsoft Draw drawing file." Unlike the substring preceding it in the document string, this substring can include spaces. If your application calls CWinApp:: RegisterShellFileTypes to register its document type(s) in the system registry, this substring is the human-readable document type name that the Windows 95 shell displays in property sheets for documents of this type.

You can omit substrings when you create a document string resource; individual substrings may be omitted by following the previous \n character with another \n, and trailing NULL substrings may be omitted altogether. If you build an application with AppWizard, of course, the document string is created for you. The resource statements for a typical SDI document string look like this:

STRINGTABLE

BEGIN

IDR_MAINFRAME "Draw\n\n\nDraw files(*.drw)\n.drw\n

Draw.Document\nDraw Document"

END

When this application is started with an empty document, its frame window will have the title "Untitled - Draw." The default file name extension for documents saved by this application is DRW, and DRW will be one of the file name extensions listed in the Open and Save As dialog boxes.

After a document template is created, substrings belonging to the document string can be retrieved with MFC's CDocTemplate::GetDocString function. For example, the statements

CString strDefExt;

pDocTemplate->GetDocString (strDefExt,

CDocTemplate::filterExt);

copy the document's default file name extension to the CString named strDefExt.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有