翻訳への提案を行います
 
他のユーザーによる提案:

progress indicator
他の提案はありません。
クリックして評価とフィードバックをお寄せください
MSDN
MSDN ライブラリ
Visual Studio 2010
Visual Studio
Visual Studio の言語
Visual C++
Visual C++ のリファレンス
MFC
MFC クラス
CDocTemplate クラス
すべて縮小/すべて展開 すべて縮小
コンテンツの表示:   英語と日本語を並べて表示コンテンツの表示: 英語と日本語を並べて表示
Visual Studio 2010 - Visual C++
CDocTemplate Class

An abstract base class that defines the basic functionality for document templates.

class CDocTemplate : public CCmdTarget

You usually create one or more document templates in the implementation of your application's InitInstance function. A document template defines the relationships among three types of classes:

  • A document class, which you derive from CDocument.

  • A view class, which displays data from the document class listed above. You can derive this class from CView, CScrollView, CFormView, or CEditView. (You can also use CEditView directly.)

  • A frame window class, which contains the view. For a single document interface (SDI) application, you derive this class from CFrameWnd. For a multiple document interface (MDI) application, you derive this class from CMDIChildWnd. If you don't need to customize the behavior of the frame window, you can use CFrameWnd or CMDIChildWnd directly without deriving your own class.

Your application has one document template for each type of document that it supports. For example, if your application supports both spreadsheets and text documents, the application has two document template objects. Each document template is responsible for creating and managing all the documents of its type.

The document template stores pointers to the CRuntimeClass objects for the document, view, and frame window classes. These CRuntimeClass objects are specified when constructing a document template.

The document template contains the ID of the resources used with the document type (such as menu, icon, or accelerator table resources). The document template also has strings containing additional information about its document type. These include the name of the document type (for example, "Worksheet") and the file extension (for example, ".xls"). Optionally, it can contain other strings used by the application's user interface, the Windows File Manager, and Object Linking and Embedding (OLE) support.

If your application is an OLE container and/or server, the document template also defines the ID of the menu used during in-place activation. If your application is an OLE server, the document template defines the ID of the toolbar and menu used during in-place activation. You specify these additional OLE resources by calling SetContainerInfo and SetServerInfo.

Because CDocTemplate is an abstract class, you cannot use the class directly. A typical application uses one of the two CDocTemplate-derived classes provided by the Microsoft Foundation Class Library: CSingleDocTemplate, which implements SDI, and CMultiDocTemplate, which implements MDI. See those classes for more information on using document templates.

If your application requires a user-interface paradigm that is fundamentally different from SDI or MDI, you can derive your own class from CDocTemplate.

For more information on CDocTemplate, see Document Templates and the Document/View Creation Process.

Header: afxwin.h

Visual Studio 2010 - Visual C++
CDocTemplate クラス

ドキュメント テンプレートの基本的な機能を定義する抽象基本クラスです。

class CDocTemplate : public CCmdTarget

通常、アプリケーションの InitInstance 関数の実装によって 1 つ以上のドキュメント テンプレートを作成します。 ドキュメント テンプレートは、次の 3 つのクラス間の関係を定義します。

  • ドキュメント クラス。これは、CDocument クラスから派生させます。

  • ビュー クラス。これは、上に挙げたドキュメント クラスのデータを表示します。 このクラスは、CViewCScrollViewCFormView、または CEditView から派生できます。 (CEditView を直接使用することもできます。)

  • フレーム ウィンドウ クラス。これは、ビューを保持します。 シングル ドキュメント インターフェイス (SDI: Single Document Interface) のアプリケーションでは、CFrameWnd から派生させます。 マルチ ドキュメント インターフェイス (MDI: Multiple Document Interface) のアプリケーションでは、CMDIChildWnd から派生させます。 フレーム ウィンドウの動作をカスタマイズする必要がない場合は、派生クラスを作成せずに直接 CFrameWnd または CMDIChildWnd を使うことができます。

アプリケーションはサポートするドキュメントの型それぞれに 1 つのドキュメント テンプレートを持ちます。 たとえば、アプリケーションがスプレッドシートとテキストのドキュメントをサポートしていれば、アプリケーションは、2 つのドキュメント テンプレート オブジェクトを持ちます。 それぞれのドキュメント テンプレートは、対応する型のすべてのドキュメントの作成、管理を行います。

ドキュメント テンプレートは、ドキュメント クラス、ビュー クラス、フレーム ウィンドウ クラスのための CRuntimeClass オブジェクトのポインターを格納します。 CRuntimeClass オブジェクトは、ドキュメント テンプレートを構築するときに指定します。

ドキュメント テンプレートは、ドキュメントの型と共に使われるリソース (メニュー、アイコン、アクセラレータ テーブルなど) の ID を保持します。 また、ドキュメント テンプレートは、ドキュメントの型についての付加情報を持つ文字列も持っています。 この情報には、ドキュメントの型の名前 (例 : "Worksheet") とファイル名の拡張子 (例 : ".xls") が含まれます。 オプションとして、Windows のファイル マネージャーや OLE (Object Linking and Embedding) のようなアプリケーションのユーザー インターフェイスで使われる文字列を含むこともできます。

アプリケーションが OLE コンテナーや OLE サーバーであるときは、ドキュメント テンプレートは、埋め込み先編集の有効化で使われるメニューの ID も定義します。 アプリケーションが OLE サーバーのときは、ドキュメント テンプレートは埋め込み先編集の有効化で使われるツール バーやメニューの ID を定義します。 SetContainerInfoSetServerInfo を呼び出して、これらの付加的な OLE リソースを指定します。

CDocTemplate は抽象クラスなので、直接使うことはできません。 2 つの一般的なアプリケーションを使用してCDocTemplate-Microsoft Foundation クラス ライブラリによって提供されるクラスを派生します。CSingleDocTemplate、SDI を実装してCMultiDocTemplate、MDI を実装します。 ドキュメント テンプレートの使い方の詳細については、これらのクラスを参照してください。

アプリケーションが、SDI や MDI とは根本的に異なる種類のユーザー インターフェイスを要求している場合は、CDocTemplate から独自の派生クラスを作成できます。

CDocTemplate の詳細については、「ドキュメント テンプレートとドキュメント/ビューの作成手順」を参照してください。

ヘッダー:afxwin.h

コミュニティ コンテンツ   コミュニティ コンテンツとは
新しいコンテンツの追加 RSS  注釈
Processing
© 2012 Microsoft. All rights reserved. 使用条件 | 商標 | プライバシー
Page view tracker