VC语言

本类阅读TOP10

·VC++ 学习笔记(二)
·用Visual C++打造IE浏览器(1)
·每个开发人员现在应该下载的十种必备工具
·教你用VC6做QQ对对碰外挂程序
·Netmsg 局域网聊天程序
·Windows消息大全
·VC++下使用ADO编写数据库程序
·VC++学习笔记(四)
·非法探取密码的原理及其防范
·怎样在VC++中访问、修改注册表

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
IDR_MAINFRAME的含义

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

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.




相关文章

相关软件