BOOL COleServerItem::IsConnected() const { // if item is connected in any way, return TRUE if (m_dwRef != 0) return TRUE; // otherwise check if embedded item and document is connected if (!IsLinkedItem() && GetDocument()->m_lpClientSite != NULL) return TRUE; return FALSE; // not connected }
void COLEContainerClassSrvrItem::Serialize(CArchive &ar) { // COLEContainerClassSrvrItem::Serialize will be called by the framework if // the item is copied to the clipboard. This can happen automatically // through the OLE callback OnGetClipboardData. A good default for // the embedded item is simply to delegate to the document's Serialize // function. If you support links, then you will want to serialize // just a portion of the document. if (!IsLinkedItem()) { COLEContainerClassDoc *pDoc = GetDocument(); ASSERT_VALID(pDoc); pDoc->Serialize(ar); } }
void CEX32ASrvrItem::Serialize(CArchive& ar) { // 항목이 클립보드에 복사되면 프레임워크에서 CEX32ASrvrItem::Serialize를 // 호출합니다. 이러한 호출은 // OLE 콜백 OnGetClipboardData를 통해 자동으로 발생시킬 수 있습니다. // 포함 항목의 경우 기본적으로 해당 문서의 Serialize 함수에 위임하는 것이 // 좋습니다. 연결을 지원할 경우에는 문서의 일부만 // serialization할 수 있습니다. if (!IsLinkedItem()) { CEX32ADoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); if (pDoc) pDoc->Serialize(ar); } }