Kontenery: elementy klienckieContainers: Client Items
W tym artykule wyjaśniono, czym są elementy klienta i od jakich klas aplikacja powinna dziedziczyć elementy klienta.This article explains what client items are and from what classes your application should derive its client items.
Elementy klienta to elementy danych należące do innej aplikacji, które są zawarte w dokumencie lub do którego odwołuje się aplikacja kontenera OLE.Client items are data items belonging to another application that are either contained in or referenced by an OLE container application's document. Elementy klienta, których dane znajdują się w dokumencie, są osadzone; te, których dane są przechowywane w innej lokalizacji, do której odwołuje się dokument kontenera, są połączone.Client items whose data is contained within the document are embedded; those whose data is stored in another location referenced by the container document are linked.
Klasa dokumentu w aplikacji OLE pochodzi od klasy COleDocument , a nie z CDocument
.The document class in an OLE application is derived from the class COleDocument rather than from CDocument
. COleDocument
Klasa dziedziczy ze CDocument
wszystkich funkcji niezbędnych do korzystania z architektury dokumentu/widoku, na których oparto aplikacje MFC.The COleDocument
class inherits from CDocument
all the functionality necessary for using the document/view architecture on which MFC applications are based. COleDocument
definiuje również interfejs, który traktuje dokument jako kolekcję CDocItem
obiektów.COleDocument
also defines an interface that treats a document as a collection of CDocItem
objects. COleDocument
Do dodawania, pobierania i usuwania elementów tej kolekcji są udostępniane kilka funkcji Członkowskich.Several COleDocument
member functions are provided for adding, retrieving, and deleting elements of that collection.
Każda aplikacja kontenera powinna dziedziczyć co najmniej jedną klasę od COleClientItem
.Every container application should derive at least one class from COleClientItem
. Obiekty tej klasy reprezentują elementy, osadzone lub połączone, w dokumencie OLE.Objects of this class represent items, embedded or linked, in the OLE document. Te obiekty istnieją w okresie istnienia dokumentu zawierającego je, chyba że zostaną usunięte z dokumentu.These objects exist for the life of the document containing them, unless they are deleted from the document.
CDocItem
jest klasą bazową dla COleClientItem
i COleServerItem
.CDocItem
is the base class for COleClientItem
and COleServerItem
. Obiekty klas pochodzących od tych dwóch działań jako pośredników między elementem OLE a aplikacjami klienta i serwera.Objects of classes derived from these two act as intermediaries between the OLE item and the client and server applications, respectively. Za każdym razem, gdy nowy element OLE zostanie dodany do dokumentu, struktura MFC dodaje nowy obiekt klasy pochodnej aplikacji klienckiej COleClientItem
do kolekcji CDocItem
obiektów dokumentu.Each time a new OLE item is added to the document, the MFC framework adds a new object of your client application's COleClientItem
-derived class to the document's collection of CDocItem
objects.
Zobacz teżSee also
ContainersContainers
Kontenery: pliki złożoneContainers: Compound Files
Kontenery: problemy z User-InterfaceContainers: User-Interface Issues
Kontenery: funkcje zaawansowaneContainers: Advanced Features
Klasa COleClientItemCOleClientItem Class
Klasa COleServerItemCOleServerItem Class