Klasa COleDocumentCOleDocument Class
Klasa bazowa dla dokumentów OLE, które obsługują edycję wizualizacji.The base class for OLE documents that support visual editing.
SkładniaSyntax
class COleDocument : public CDocument
Elementy członkowskieMembers
Konstruktory publicznePublic Constructors
NazwaName | OpisDescription |
---|---|
COleDocument::COleDocumentCOleDocument::COleDocument | Konstruuje COleDocument obiekt.Constructs a COleDocument object. |
Metody publicznePublic Methods
NazwaName | OpisDescription |
---|---|
COleDocument:: AddItemCOleDocument::AddItem | Dodaje element do listy elementów obsługiwanych przez dokument.Adds an item to the list of items maintained by the document. |
COleDocument::ApplyPrintDeviceCOleDocument::ApplyPrintDevice | Ustawia urządzenie drukowania-docelowego dla wszystkich elementów klienta w dokumencie.Sets the print-target device for all client items in the document. |
COleDocument::EnableCompoundFileCOleDocument::EnableCompoundFile | Powoduje, że dokumenty są przechowywane przy użyciu formatu pliku magazynu strukturalnego OLE.Causes documents to be stored using the OLE Structured Storage file format. |
COleDocument::GetInPlaceActiveItemCOleDocument::GetInPlaceActiveItem | Zwraca element OLE, który jest obecnie aktywny.Returns the OLE item that is currently in-place active. |
COleDocument::GetNextClientItemCOleDocument::GetNextClientItem | Pobiera następny element klienta do iteracji.Gets the next client item for iterating. |
COleDocument::GetNextItemCOleDocument::GetNextItem | Pobiera następny element dokumentu do iteracji.Gets the next document item for iterating. |
COleDocument::GetNextServerItemCOleDocument::GetNextServerItem | Pobiera następny element serwera do iteracji.Gets the next server item for iterating. |
COleDocument::GetPrimarySelectedItemCOleDocument::GetPrimarySelectedItem | Zwraca podstawowy wybrany element OLE w dokumencie.Returns the primary selected OLE item in the document. |
COleDocument::GetStartPositionCOleDocument::GetStartPosition | Pobiera początkową pozycję, aby rozpocząć iterację.Gets the initial position to begin iteration. |
COleDocument::HasBlankItemsCOleDocument::HasBlankItems | Wyszukuje puste elementy w dokumencie.Checks for blank items in the document. |
COleDocument::OnShowViewsCOleDocument::OnShowViews | Wywołuje się, gdy dokument jest widoczny lub niewidoczny.Called when the document becomes visible or invisible. |
COleDocument:: RemoveItemCOleDocument::RemoveItem | Usuwa element z listy elementów obsługiwanych przez dokument.Removes an item from the list of items maintained by the document. |
COleDocument::UpdateModifiedFlagCOleDocument::UpdateModifiedFlag | Oznacza dokument jako zmodyfikowany, jeśli którykolwiek z zawartych w nim elementów OLE został zmodyfikowany.Marks the document as modified if any of the contained OLE items have been modified. |
Metody chronioneProtected Methods
NazwaName | OpisDescription |
---|---|
COleDocument::OnEditChangeIconCOleDocument::OnEditChangeIcon | Obsługuje zdarzenia w menu Zmień ikonę.Handles events in the Change Icon menu command. |
COleDocument::OnEditConvertCOleDocument::OnEditConvert | Obsługuje konwersję osadzonego lub połączonego obiektu z jednego typu na drugi.Handles the conversion of an embedded or linked object from one type to another. |
COleDocument::OnEditLinksCOleDocument::OnEditLinks | Obsługuje zdarzenia w poleceniu Links w menu Edycja.Handles events in the Links command on the Edit menu. |
COleDocument::OnFileSendMailCOleDocument::OnFileSendMail | Wysyła wiadomość e-mail z dołączonym dokumentem.Sends a mail message with the document attached. |
COleDocument::OnUpdateEditChangeIconCOleDocument::OnUpdateEditChangeIcon | Wywoływane przez platformę, aby zaktualizować interfejs użytkownika poleceń dla opcji menu Edytuj/Zmień.Called by the framework to update the command UI for the Edit/Change Icon menu option. |
COleDocument::OnUpdateEditLinksMenuCOleDocument::OnUpdateEditLinksMenu | Wywoływane przez platformę, aby zaktualizować interfejs użytkownika poleceń dla opcji menu Edytuj/linki.Called by the framework to update the command UI for the Edit/Links menu option. |
COleDocument::OnUpdateObjectVerbMenuCOleDocument::OnUpdateObjectVerbMenu | Wywoływane przez platformę, aby zaktualizować interfejs użytkownika poleceń dla opcji menu Edytuj/ ObjectName i podmenu czasownik, do którego można uzyskać dostęp z edycji/ ObjectName.Called by the framework to update the command UI for the Edit/ ObjectName menu option and the Verb submenu accessed from Edit/ ObjectName. |
COleDocument::OnUpdatePasteLinkMenuCOleDocument::OnUpdatePasteLinkMenu | Wywoływane przez platformę, aby zaktualizować interfejs użytkownika poleceń dla opcji menu Wklej specjalnie.Called by the framework to update the command UI for the Paste Special menu option. |
COleDocument::OnUpdatePasteMenuCOleDocument::OnUpdatePasteMenu | Wywoływane przez platformę, aby zaktualizować interfejs użytkownika poleceń dla opcji menu Wklej.Called by the framework to update the command UI for the Paste menu option. |
UwagiRemarks
COleDocument
pochodzi od CDocument
, co umożliwia aplikacjom OLE używanie architektury dokumentu/widoku dostarczonej przez Biblioteka MFC.COleDocument
is derived from CDocument
, which allows your OLE applications to use the document/view architecture provided by the Microsoft Foundation Class Library.
COleDocument
traktuje dokument jako kolekcję obiektów CDocItem do obsługi elementów OLE.COleDocument
treats a document as a collection of CDocItem objects to handle OLE items. Aplikacje kontenerów i serwerów wymagają takiej architektury, ponieważ ich dokumenty muszą być w stanie zawierać elementy OLE.Both container and server applications require such an architecture because their documents must be able to contain OLE items. Klasy COleServerItem i COleClientItem , które pochodzą z CDocItem
, zarządzają interakcjami między aplikacjami i elementami OLE.The COleServerItem and COleClientItem classes, both derived from CDocItem
, manage the interactions between applications and OLE items.
Jeśli piszesz prostą aplikację kontenera, Utwórz klasę dokumentu z COleDocument
.If you are writing a simple container application, derive your document class from COleDocument
. Jeśli piszesz aplikację kontenera, która obsługuje łączenie z osadzonymi elementami zawartymi w jego dokumentach, Utwórz klasę dokumentu z COleLinkingDoc.If you are writing a container application that supports linking to the embedded items contained by its documents, derive your document class from COleLinkingDoc. W przypadku pisania aplikacji serwera lub kontenera/serwera, Utwórz klasę dokumentu z COleServerDoc.If you are writing a server application or combination container/server, derive your document class from COleServerDoc. COleLinkingDoc
i pochodzą COleServerDoc
z COleDocument
, więc te klasy dziedziczą wszystkie usługi dostępne w COleDocument
i CDocument
.COleLinkingDoc
and COleServerDoc
are derived from COleDocument
, so these classes inherit all the services available in COleDocument
and CDocument
.
Aby użyć COleDocument
, należy utworzyć z niej klasę i dodać funkcje do zarządzania danymi nienależącymi do OLE, a także elementami osadzonymi lub połączonymi.To use COleDocument
, derive a class from it and add functionality to manage the application's non-OLE data as well as embedded or linked items. Jeśli zdefiniujesz CDocItem
klasy pochodne do przechowywania danych natywnych aplikacji, możesz użyć domyślnej implementacji zdefiniowanej przez program COleDocument
do przechowywania zarówno danych OLE, jak i innych niż OLE.If you define CDocItem
-derived classes to store the application's native data, you can use the default implementation defined by COleDocument
to store both your OLE and non-OLE data. Możesz również projektować własne struktury danych do przechowywania danych nienależących do OLE niezależnie od elementów OLE.You can also design your own data structures for storing your non-OLE data separately from the OLE items. Aby uzyskać więcej informacji, zobacz kontenery artykułów: pliki złożone...For more information, see the article Containers: Compound Files..
CDocument
obsługuje wysyłanie dokumentu za pośrednictwem poczty, jeśli istnieje obsługa poczty (MAPI).CDocument
supports sending your document via mail if mail support (MAPI) is present. COleDocument
zaktualizował OnFileSendMail w celu poprawnego obsługi dokumentów złożonych.COleDocument
has updated OnFileSendMail to handle compound documents correctly. Aby uzyskać więcej informacji, zapoznaj się z artykułami obsługa MAPI i MAPI w MFC..For more information, see the articles MAPI and MAPI Support in MFC..
Hierarchia dziedziczeniaInheritance Hierarchy
COleDocument
WymaganiaRequirements
Nagłówek: Afxole. hHeader: afxole.h
COleDocument:: AddItemCOleDocument::AddItem
Wywołaj tę funkcję, aby dodać element do dokumentu.Call this function to add an item to the document.
virtual void AddItem(CDocItem* pItem);
ParametryParameters
pItempItem
Wskaźnik do dodawanego elementu dokumentu.Pointer to the document item being added.
UwagiRemarks
Nie ma potrzeby wywoływania tej funkcji jawnie, gdy jest wywoływana przez COleClientItem
COleServerItem
konstruktora lub, który akceptuje wskaźnik do dokumentu.You do not need to call this function explicitly when it is called by the COleClientItem
or COleServerItem
constructor that accepts a pointer to a document.
COleDocument::ApplyPrintDeviceCOleDocument::ApplyPrintDevice
Wywołaj tę funkcję, aby zmienić urządzenie Print-Target dla wszystkich osadzonych elementów COleClientItem w dokumencie kontenera aplikacji.Call this function to change the print-target device for all embedded COleClientItem items in your application's container document.
BOOL ApplyPrintDevice(const DVTARGETDEVICE* ptd);
BOOL ApplyPrintDevice(const PRINTDLG* ppd);
ParametryParameters
ptdptd
Wskaźnik do DVTARGETDEVICE
struktury danych, który zawiera informacje o nowym urządzeniu drukowania.Pointer to a DVTARGETDEVICE
data structure, which contains information about the new print-target device. Może mieć wartość NULL.Can be NULL.
PPDppd
Wskaźnik do PRINTDLG
struktury danych, który zawiera informacje o nowym urządzeniu drukowania.Pointer to a PRINTDLG
data structure, which contains information about the new print-target device. Może mieć wartość NULL.Can be NULL.
Wartość zwracanaReturn Value
Niezerowe, jeśli funkcja zakończyła się pomyślnie; w przeciwnym razie 0.Nonzero if the function was successful; otherwise 0.
UwagiRemarks
Ta funkcja aktualizuje urządzenie drukowania-docelowego dla wszystkich elementów, ale nie odświeża pamięci podręcznej prezentacji dla tych elementów.This function updates the print-target device for all items but does not refresh the presentation cache for those items. Aby zaktualizować pamięć podręczną prezentacji dla elementu, wywołaj COleClientItem:: UpdateLink.To update the presentation cache for an item, call COleClientItem::UpdateLink.
Argumenty tej funkcji zawierają informacje używane przez technologię OLE do identyfikowania urządzenia docelowego.The arguments to this function contain information that OLE uses to identify the target device. Struktura PRINTDLG zawiera informacje używane przez system Windows do zainicjowania wspólnego okna dialogowego drukowania.The PRINTDLG structure contains information that Windows uses to initialize the common Print dialog box. Gdy użytkownik zamknie okno dialogowe, system Windows zwróci informacje o wyborach użytkownika w tej strukturze.After the user closes the dialog box, Windows returns information about the user's selections in this structure. m_pd
Element członkowski obiektu CPrintDialog jest PRINTDLG
strukturą.The m_pd
member of a CPrintDialog object is a PRINTDLG
structure.
Aby uzyskać więcej informacji, zapoznaj się ze strukturą PRINTDLG w Windows SDK.For more information, see the PRINTDLG structure in the Windows SDK.
Aby uzyskać więcej informacji, zapoznaj się ze strukturą DVTARGETDEVICE w Windows SDK.For more information, see the DVTARGETDEVICE structure in the Windows SDK.
COleDocument::COleDocumentCOleDocument::COleDocument
Konstruuje COleDocument
obiekt.Constructs a COleDocument
object.
COleDocument();
COleDocument::EnableCompoundFileCOleDocument::EnableCompoundFile
Wywołaj tę funkcję, jeśli chcesz przechowywać dokument przy użyciu formatu pliku złożonego.Call this function if you want to store the document using the compound-file format.
void EnableCompoundFile(BOOL bEnable = TRUE);
ParametryParameters
bEnablebEnable
Określa, czy obsługa plików złożonych jest włączona czy wyłączona.Specifies whether compound file support is enabled or disabled.
UwagiRemarks
Jest to również nazywane magazynem strukturalnym.This is also called structured storage. Zazwyczaj wywoływana jest ta funkcja z konstruktora COleDocument
klasy pochodnej.You typically call this function from the constructor of your COleDocument
-derived class. Aby uzyskać więcej informacji o dokumentach złożonych, zobacz kontenery artykułów: pliki złożone...For more information about compound documents, see the article Containers: Compound Files..
Jeśli ta funkcja członkowska nie zostanie wywołana, dokumenty będą przechowywane w formacie pliku bez struktury ("Flat").If you do not call this member function, documents will be stored in a nonstructured ("flat") file format.
Po włączeniu lub wyłączeniu obsługi plików złożonych dla dokumentu nie należy zmieniać tego ustawienia w okresie istnienia dokumentu.After compound file support is enabled or disabled for a document, the setting should not be changed during the document's lifetime.
COleDocument::GetInPlaceActiveItemCOleDocument::GetInPlaceActiveItem
Wywołaj tę funkcję, aby pobrać element OLE, który jest aktualnie aktywowany w miejscu w oknie ramki zawierającym widok identyfikowany przez pWnd.Call this function to get the OLE item that is currently activated in place in the frame window containing the view identified by pWnd.
virtual COleClientItem* GetInPlaceActiveItem(CWnd* pWnd);
ParametryParameters
pWndpWnd
Wskaźnik do okna, w którym jest wyświetlany dokument kontenera.Pointer to the window that displays the container document.
Wartość zwracanaReturn Value
Wskaźnik do pojedynczego, w miejscu aktywnego elementu OLE; Wartość NULL, jeśli w stanie "w miejscu aktywnym" nie ma obecnie elementu OLE.A pointer to the single, in-place active OLE item; NULL if there is no OLE item currently in the "in-place active" state.
COleDocument::GetNextClientItemCOleDocument::GetNextClientItem
Wielokrotnie Wywołaj tę funkcję, aby uzyskać dostęp do każdego elementu klienta w dokumencie.Call this function repeatedly to access each of the client items in your document.
COleClientItem* GetNextClientItem(POSITION& pos) const;
ParametryParameters
Terminalpos
Odwołanie do wartości pozycji ustawionej przez poprzednie wywołanie GetNextClientItem
; wartość początkowa jest zwracana przez GetStartPosition
funkcję członkowską.A reference to a POSITION value set by a previous call to GetNextClientItem
; the initial value is returned by the GetStartPosition
member function.
Wartość zwracanaReturn Value
Wskaźnik do następnego elementu klienta w dokumencie lub wartość NULL, jeśli nie ma więcej elementów klienta.A pointer to the next client item in the document, or NULL if there are no more client items.
UwagiRemarks
Po każdym wywołaniu wartość pos jest ustawiana dla następnego elementu w dokumencie, który może być lub nie jest elementem klienta.After each call, the value of pos is set for the next item in the document, which might or might not be a client item.
PrzykładExample
// pDoc points to a COleDocument object
POSITION pos = pDoc->GetStartPosition();
COleClientItem* pItem;
CString strType;
while ((pItem = pDoc->GetNextClientItem(pos)) != NULL)
{
// Use pItem
pItem->GetUserType(USERCLASSTYPE_FULL, strType);
TRACE(strType);
}
COleDocument::GetNextItemCOleDocument::GetNextItem
Wielokrotnie Wywołaj tę funkcję, aby uzyskać dostęp do wszystkich elementów w dokumencie.Call this function repeatedly to access each of the items in your document.
virtual CDocItem* GetNextItem(POSITION& pos) const;
ParametryParameters
Terminalpos
Odwołanie do wartości pozycji ustawionej przez poprzednie wywołanie GetNextItem
; wartość początkowa jest zwracana przez GetStartPosition
funkcję członkowską.A reference to a POSITION value set by a previous call to GetNextItem
; the initial value is returned by the GetStartPosition
member function.
Wartość zwracanaReturn Value
Wskaźnik do elementu dokumentu na określonej pozycji.A pointer to the document item at the specified position.
UwagiRemarks
Po każdym wywołaniu wartość pos jest ustawiana na wartość pozycji następnego elementu w dokumencie.After each call, the value of pos is set to the POSITION value of the next item in the document. Jeśli pobrany element jest ostatnim elementem w dokumencie, Nowa wartość pos ma wartość null.If the retrieved element is the last element in the document, the new value of pos is NULL.
PrzykładExample
// pDoc points to a COleDocument object
POSITION pos = pDoc->GetStartPosition();
CDocItem* pItem;
CString strType;
while (pos != NULL)
{
pItem = pDoc->GetNextItem(pos);
// Use pItem
if (pItem->IsKindOf(RUNTIME_CLASS(COleClientItem)))
{
((COleClientItem*)pItem)->GetUserType(USERCLASSTYPE_FULL, strType);
TRACE(strType);
}
}
COleDocument::GetNextServerItemCOleDocument::GetNextServerItem
Wielokrotnie Wywołaj tę funkcję, aby uzyskać dostęp do wszystkich elementów serwera w dokumencie.Call this function repeatedly to access each of the server items in your document.
COleServerItem* GetNextServerItem(POSITION& pos) const;
ParametryParameters
Terminalpos
Odwołanie do wartości pozycji ustawionej przez poprzednie wywołanie GetNextServerItem
; wartość początkowa jest zwracana przez GetStartPosition
funkcję członkowską.A reference to a POSITION value set by a previous call to GetNextServerItem
; the initial value is returned by the GetStartPosition
member function.
Wartość zwracanaReturn Value
Wskaźnik do następnego elementu serwera w dokumencie lub wartość NULL, jeśli nie ma więcej elementów serwera.A pointer to the next server item in the document, or NULL if there are no more server items.
UwagiRemarks
Po każdym wywołaniu wartość pos jest ustawiana dla następnego elementu w dokumencie, który może być lub może nie być elementem serwera.After each call, the value of pos is set for the next item in the document, which might or might not be a server item.
PrzykładExample
// pDoc points to a COleDocument object
POSITION pos = pDoc->GetStartPosition();
COleServerItem* pItem;
while ((pItem = pDoc->GetNextServerItem(pos)) != NULL)
{
// Use pItem
}
COleDocument::GetPrimarySelectedItemCOleDocument::GetPrimarySelectedItem
Wywoływane przez platformę, by pobrać aktualnie wybrany element OLE w określonym widoku.Called by the framework to retrieve the currently selected OLE item in the specified view.
virtual COleClientItem* GetPrimarySelectedItem(CView* pView);
ParametryParameters
pViewpView
Wskaźnik do aktywnego obiektu widoku wyświetlającego dokument.Pointer to the active view object displaying the document.
Wartość zwracanaReturn Value
Wskaźnik do pojedynczego, wybranego elementu OLE; Wartość NULL, jeśli nie wybrano żadnych elementów OLE lub wybrano więcej niż jeden element.A pointer to the single, selected OLE item; NULL if no OLE items are selected or if more than one is selected.
UwagiRemarks
Domyślna implementacja przeszukuje listę zawartych elementów OLE dla pojedynczego zaznaczonego elementu i zwraca do niego wskaźnik.The default implementation searches the list of contained OLE items for a single selected item and returns a pointer to it. Jeśli nie wybrano żadnego elementu lub jeśli wybrano więcej niż jeden element, funkcja zwraca wartość NULL.If there is no item selected, or if there is more than one item selected, the function returns NULL. Aby CView::IsSelected
Ta funkcja działała, należy zastąpić funkcję członkowską w klasie widoku.You must override the CView::IsSelected
member function in your view class for this function to work. Zastąp tę funkcję, jeśli masz własną metodę przechowywania zawartych elementów OLE.Override this function if you have your own method of storing contained OLE items.
COleDocument::GetStartPositionCOleDocument::GetStartPosition
Wywołaj tę funkcję, aby pobrać pozycję pierwszego elementu w dokumencie.Call this function to get the position of the first item in the document.
virtual POSITION GetStartPosition() const;
Wartość zwracanaReturn Value
Wartość pozycji, której można użyć, aby rozpocząć iterację elementów dokumentu; Wartość NULL, jeśli dokument nie zawiera żadnych elementów.A POSITION value that can be used to begin iterating through the document's items; NULL if the document has no items.
UwagiRemarks
Przekaż wartość zwracaną do GetNextItem
, GetNextClientItem
lub GetNextServerItem
.Pass the value returned to GetNextItem
, GetNextClientItem
, or GetNextServerItem
.
COleDocument::HasBlankItemsCOleDocument::HasBlankItems
Wywołaj tę funkcję, aby określić, czy dokument zawiera puste elementy.Call this function to determine whether the document contains any blank items.
BOOL HasBlankItems() const;
Wartość zwracanaReturn Value
Niezerowe, jeśli dokument zawiera puste elementy; w przeciwnym razie 0.Nonzero if the document contains any blank items; otherwise 0.
UwagiRemarks
Pusty element to jeden, którego prostokąt jest pusty.A blank item is one whose rectangle is empty.
COleDocument::OnEditChangeIconCOleDocument::OnEditChangeIcon
Wyświetla okno dialogowe ikona zmiany OLE i zmienia ikonę reprezentującą aktualnie zaznaczony element OLE do ikony, którą użytkownik wybiera w oknie dialogowym.Displays the OLE Change Icon dialog box and changes the icon representing the currently selected OLE item to the icon the user selects in the dialog box.
afx_msg void OnEditChangeIcon();
UwagiRemarks
OnEditChangeIcon
tworzy i uruchamia okno COleChangeIconDialog
dialogowe Zmień ikonę.OnEditChangeIcon
creates and launches a COleChangeIconDialog
Change Icon dialog box.
COleDocument::OnEditConvertCOleDocument::OnEditConvert
Wyświetla okno dialogowe Konwersja OLE i konwertuje lub aktywuje aktualnie zaznaczony element OLE zgodnie z wybranymi przez użytkownika w oknie dialogowym.Displays the OLE Convert dialog box and converts or activates the currently selected OLE item according to user selections in the dialog box.
afx_msg void OnEditConvert();
UwagiRemarks
OnEditConvert
tworzy i uruchamia okno COleConvertDialog
dialogowe konwersji.OnEditConvert
creates and launches a COleConvertDialog
Convert dialog box.
Przykład konwersji polega na konwertowaniu dokumentu programu Microsoft Word do dokumentu programu WordPad.An example of conversion is converting a Microsoft Word document into a WordPad document.
COleDocument::OnEditLinksCOleDocument::OnEditLinks
Wyświetla okno dialogowe Edytowanie/łącza OLE.Displays the OLE Edit/Links dialog box.
afx_msg void OnEditLinks();
UwagiRemarks
OnEditLinks
tworzy i uruchamia okno COleLinksDialog
dialogowe linki umożliwiające użytkownikowi zmianę połączonych obiektów.OnEditLinks
creates and launches a COleLinksDialog
Links dialog box that allows the user to change the linked objects.
COleDocument::OnFileSendMailCOleDocument::OnFileSendMail
Wysyła komunikat za pośrednictwem zamieszkałego hosta poczty (jeśli istnieje) do dokumentu jako załącznik.Sends a message via the resident mail host (if any) with the document as an attachment.
afx_msg void OnFileSendMail();
UwagiRemarks
OnFileSendMail
wywołania OnSaveDocument
serializacji (Save) bez tytułu i modyfikacji dokumentów do pliku tymczasowego, który następnie jest wysyłany pocztą elektroniczną.OnFileSendMail
calls OnSaveDocument
to serialize (save) untitled and modified documents to a temporary file, which is then sent via electronic mail. Jeśli dokument nie został zmodyfikowany, plik tymczasowy nie jest wymagany; zostanie wysłany oryginalny.If the document has not been modified, a temporary file is not needed; the original is sent. OnFileSendMail
ładuje MAPI32.DLL, jeśli nie została jeszcze załadowana.OnFileSendMail
loads MAPI32.DLL if it has not already been loaded.
W przeciwieństwie do implementacji programu OnFileSendMail
dla programu CDocument
Ta funkcja obsługuje pliki złożone prawidłowo.Unlike the implementation of OnFileSendMail
for CDocument
, this function handles compound files correctly.
Aby uzyskać więcej informacji, zobacz Tematy dotyczące MAPI i Obsługa MAPI w artykułach MFC..For more information, see the MAPI Topics and MAPI Support in MFC articles..
COleDocument::OnShowViewsCOleDocument::OnShowViews
Struktura wywołuje tę funkcję po zmianie stanu widoczności dokumentu.The framework calls this function after the document's visibility state changes.
virtual void OnShowViews(BOOL bVisible);
ParametryParameters
bVisiblebVisible
Wskazuje, czy dokument stał się widoczny czy niewidoczny.Indicates whether the document has become visible or invisible.
UwagiRemarks
Domyślna wersja tej funkcji nic nie robi.The default version of this function does nothing. Zastąp go, jeśli aplikacja musi wykonać jakiekolwiek specjalne przetwarzanie, gdy zmieni się widoczność dokumentu.Override it if your application must perform any special processing when the document's visibility changes.
COleDocument::OnUpdateEditChangeIconCOleDocument::OnUpdateEditChangeIcon
Wywoływane przez platformę, aby zaktualizować polecenie Zmień ikonę w menu Edycja.Called by the framework to update the Change Icon command on the Edit menu.
afx_msg void OnUpdateEditChangeIcon(CCmdUI* pCmdUI);
ParametryParameters
pCmdUIpCmdUI
Wskaźnik do CCmdUI
struktury, która reprezentuje menu, które wygenerowało polecenie aktualizacji.A pointer to a CCmdUI
structure that represents the menu that generated the update command. Procedura obsługi aktualizacji wywołuje Enable
funkcję członkowską CCmdUI
struktury za pomocą pCmdUI , aby zaktualizować interfejs użytkownika.The update handler calls the Enable
member function of the CCmdUI
structure through pCmdUI to update the user interface.
UwagiRemarks
OnUpdateEditChangeIcon
aktualizuje interfejs użytkownika polecenia w zależności od tego, czy w dokumencie istnieje prawidłowa ikona.OnUpdateEditChangeIcon
updates the command's user interface depending on whether or not a valid icon exists in the document. Zastąp tę funkcję, aby zmienić zachowanie.Override this function to change the behavior.
COleDocument::OnUpdateEditLinksMenuCOleDocument::OnUpdateEditLinksMenu
Wywoływane przez platformę, aby zaktualizować polecenie Links w menu Edycja.Called by the framework to update the Links command on the Edit menu.
afx_msg void OnUpdateEditLinksMenu(CCmdUI* pCmdUI);
ParametryParameters
pCmdUIpCmdUI
Wskaźnik do CCmdUI
struktury, która reprezentuje menu, które wygenerowało polecenie aktualizacji.A pointer to a CCmdUI
structure that represents the menu that generated the update command. Procedura obsługi aktualizacji wywołuje Enable
funkcję członkowską CCmdUI
struktury za pomocą pCmdUI , aby zaktualizować interfejs użytkownika.The update handler calls the Enable
member function of the CCmdUI
structure through pCmdUI to update the user interface.
UwagiRemarks
Począwszy od pierwszego elementu OLE w dokumencie, OnUpdateEditLinksMenu
uzyskuje dostęp do każdego elementu, testuje, czy element jest łączem, a jeśli jest łączem, włącza polecenie łącza.Starting with the first OLE item in the document, OnUpdateEditLinksMenu
accesses each item, tests whether the item is a link, and, if it is a link, enables the Links command. Zastąp tę funkcję, aby zmienić zachowanie.Override this function to change the behavior.
COleDocument::OnUpdateObjectVerbMenuCOleDocument::OnUpdateObjectVerbMenu
Wywoływane przez platformę, aby zaktualizować polecenie ObjectName w menu Edycja i podmenu czasownik, do którego można uzyskać dostęp z obiektu ObjectName , gdzie ObjectName jest nazwą obiektów OLE osadzonych w dokumencie.Called by the framework to update the ObjectName command on the Edit menu and the Verb submenu accessed from the ObjectName command, where ObjectName is the name of the OLE object embedded in the document.
afx_msg void OnUpdateObjectVerbMenu(CCmdUI* pCmdUI);
ParametryParameters
pCmdUIpCmdUI
Wskaźnik do CCmdUI
struktury, która reprezentuje menu, które wygenerowało polecenie aktualizacji.A pointer to a CCmdUI
structure that represents the menu that generated the update command. Procedura obsługi aktualizacji wywołuje Enable
funkcję członkowską CCmdUI
struktury za pomocą pCmdUI , aby zaktualizować interfejs użytkownika.The update handler calls the Enable
member function of the CCmdUI
structure through pCmdUI to update the user interface.
UwagiRemarks
OnUpdateObjectVerbMenu
aktualizuje interfejs użytkownika polecenia ObjectName , w zależności od tego, czy w dokumencie istnieje prawidłowy obiekt.OnUpdateObjectVerbMenu
updates the ObjectName command's user interface depending on whether or not a valid object exists in the document. Jeśli obiekt istnieje, polecenie ObjectName w menu Edycja jest włączone.If an object exists, the ObjectName command on the Edit menu is enabled. Po wybraniu tego polecenia menu zostanie wyświetlone podmenu zlecenie.When this menu command is selected, the Verb submenu is displayed. Podmenu zlecenie zawiera wszystkie polecenia zleceń dostępne dla obiektu, takie jak Edycja, właściwości i tak dalej.The Verb submenu contains all the verb commands available for the object, such as Edit, Properties, and so on. Zastąp tę funkcję, aby zmienić zachowanie.Override this function to change the behavior.
COleDocument::OnUpdatePasteLinkMenuCOleDocument::OnUpdatePasteLinkMenu
Wywoływane przez platformę, aby określić, czy połączony element OLE można wkleić ze schowka.Called by the framework to determine whether a linked OLE item can be pasted from the Clipboard.
afx_msg void OnUpdatePasteLinkMenu(CCmdUI* pCmdUI);
ParametryParameters
pCmdUIpCmdUI
Wskaźnik do CCmdUI
struktury, która reprezentuje menu, które wygenerowało polecenie aktualizacji.A pointer to a CCmdUI
structure that represents the menu that generated the update command. Procedura obsługi aktualizacji wywołuje Enable
funkcję członkowską CCmdUI
struktury za pomocą pCmdUI , aby zaktualizować interfejs użytkownika.The update handler calls the Enable
member function of the CCmdUI
structure through pCmdUI to update the user interface.
UwagiRemarks
Polecenie Wklej specjalne menu jest włączone lub wyłączone w zależności od tego, czy element można wkleić do dokumentu, czy nie.The Paste Special menu command is enabled or disabled depending on whether the item can be pasted into the document or not.
COleDocument::OnUpdatePasteMenuCOleDocument::OnUpdatePasteMenu
Wywoływane przez platformę, aby określić, czy osadzony element OLE można wkleić ze schowka.Called by the framework to determine whether an embedded OLE item can be pasted from the Clipboard.
afx_msg void OnUpdatePasteMenu(CCmdUI* pCmdUI);
ParametryParameters
pCmdUIpCmdUI
Wskaźnik do CCmdUI
struktury, która reprezentuje menu, które wygenerowało polecenie aktualizacji.A pointer to a CCmdUI
structure that represents the menu that generated the update command. Procedura obsługi aktualizacji wywołuje Enable
funkcję członkowską CCmdUI
struktury za pomocą pCmdUI , aby zaktualizować interfejs użytkownika.The update handler calls the Enable
member function of the CCmdUI
structure through pCmdUI to update the user interface.
UwagiRemarks
Polecenie Wklej menu i przycisk jest włączone lub wyłączone w zależności od tego, czy element można wkleić do dokumentu, czy nie.The Paste menu command and button are enabled or disabled depending on whether the item can be pasted into the document or not.
COleDocument:: RemoveItemCOleDocument::RemoveItem
Wywołaj tę funkcję, aby usunąć element z dokumentu.Call this function to remove an item from the document.
virtual void RemoveItem(CDocItem* pItem);
ParametryParameters
pItempItem
Wskaźnik na element dokumentu, który ma zostać usunięty.Pointer to the document item to be removed.
UwagiRemarks
Zazwyczaj nie trzeba wywoływać tej funkcji jawnie; jest wywoływana przez destruktory dla COleClientItem
i COleServerItem
.You typically do not need to call this function explicitly; it is called by the destructors for COleClientItem
and COleServerItem
.
COleDocument::UpdateModifiedFlagCOleDocument::UpdateModifiedFlag
Wywołaj tę funkcję, aby oznaczyć dokument jako zmodyfikowany, jeśli którykolwiek z zawartych w nim elementów OLE został zmodyfikowany.Call this function to mark the document as modified if any of the contained OLE items have been modified.
virtual void UpdateModifiedFlag();
UwagiRemarks
Dzięki temu platforma może monitować użytkownika o zapisanie dokumentu przed zamknięciem, nawet jeśli dane natywne w dokumencie nie zostały zmodyfikowane.This allows the framework to prompt the user to save the document before closing, even if the native data in the document has not been modified.
Zobacz teżSee also
Przykładowy kontener MFCMFC Sample CONTAINER
Przykład MFCBIND MFCMFC Sample MFCBIND
Klasa CDocumentCDocument Class
Wykres hierarchiiHierarchy Chart