OCLIENT: Illustrates a Visual Editing Container Application

Click to open or copy the OCLIENT project files.

OCLIENT is an example of a visual editing container application. It is essentially an extended version of the CONTAINER tutorial sample, although it is not strictly a derivation of CONTAINER. OCLIENT illustrates these additional features:

See Help: Compiling and Testing Your Help File.

Refer to the CONTAINER tutorial in Tutorials for an introduction to Microsoft Foundation Class Library (MFC) support for visual editing container applications. Refer to the OCLIENT sources for techniques for implementing the above features.

Running OCLIENT

OCLIENT, like CONTAINER, is a simple object-drawing program. The only type of object it draws is a linked or embedded OLE item. You can add a new object to the OCLIENT drawing in either of the following ways:

The newly added OLE item is always placed in the top-left corner of the OCLIENT drawing. The new OLE item might partially or completely cover an older item. You can select one OLE item at a time using the mouse. A selected linked item is indicated with a dotted rectangle, and an embedded item is indicated with a solid rectangle. You can move an OLE item by dragging it; you can resize a selected OLE item by using the resize handles.

To delete an OLE item, select it with a mouse click, then click DELETE or use the Edit Clear menu command.

To edit the contents of an OLE item, double-click it or select it with the mouse and then click Edit <type> Object on the Edit menu. To complete the editing of an in-place editing item, click somewhere outside the rectangle of the item in OCLIENT's window. To complete the editing of an item that has been fully opened in the server application, use the server's File Update command.

This sample demonstrates the following keywords:

AfxGetMainWnd; AfxMessageBox; AfxOleInit; AfxThrowArchiveException; AfxThrowFileException; AfxThrowMemoryException; CArchive::Close; CArchive::IsStoring; CCmdTarget::BeginWaitCursor; CCmdTarget::EndWaitCursor; CCmdUI::Enable; CCmdUI::SetCheck; CControlBar::EnableDocking; CDC::DPtoLP; CDC::DrawFocusRect; CDC::GetDeviceCaps; CDC::HIMETRICtoDP; CDC::LPtoDP; CDC::RealizePalette; CDC::SelectPalette; CDocTemplate::SetContainerInfo; CDocument::SetModifiedFlag; CDocument::UpdateAllViews; CFrameWnd::DockControlBar; CFrameWnd::EnableDocking; CFrameWnd::LoadFrame; CFrameWnd::OnCreateClient; CGdiObject::UnrealizeObject; CMDIChildWnd::Create; CMenu::GetSubMenu; CMenu::LoadMenu; CMenu::TrackPopupMenu; CObject::AssertValid; CObject::Dump; CObject::IsKindOf; CObject::Serialize; COleClientItem::Close; COleClientItem::CreateCloneFrom; COleClientItem::Deactivate; COleClientItem::Delete; COleClientItem::DoDragDrop; COleClientItem::DoVerb; COleClientItem::Draw; COleClientItem::GetActiveView; COleClientItem::GetClipboardData; COleClientItem::GetDocument; COleClientItem::GetDrawAspect; COleClientItem::GetInPlaceWindow; COleClientItem::GetItemState; COleClientItem::GetType; COleClientItem::IsInPlaceActive; COleClientItem::OnActivate; COleClientItem::OnChange; COleClientItem::OnChangeItemPosition; COleClientItem::OnDeactivateUI; COleClientItem::OnGetClipboardData; COleClientItem::OnGetItemPosition; COleClientItem::SetDrawAspect; COleClientItem::SetItemRects; COleClientItem::UpdateLink; COleDataObject::Attach; COleDataObject::AttachClipboard; COleDataObject::IsDataAvailable; COleDataSource::CacheGlobalData; COleDocument::EnableCompoundFile; COleDocument::GetNextItem; COleDocument::GetStartPosition; COleDocument::HasBlankItems; COleDocument::OnShowViews; COleInsertDialog::CreateItem; COleInsertDialog::DoModal; COleInsertDialog::GetSelectionType; COlePasteSpecialDialog::AddFormat; COlePasteSpecialDialog::AddStandardFormats; COlePasteSpecialDialog::CreateItem; COlePasteSpecialDialog::DoModal; COlePasteSpecialDialog::GetSelectionType; COleTemplateServer::ConnectTemplate; COleTemplateServer::UpdateRegistry; COleUpdateDialog::DoModal; CPalette::CreateHalftonePalette; CRect::InflateRect; CRect::IntersectRect; CRect::IsRectEmpty; CRect::OffsetRect; CRect::Size; CRect::TopLeft; CRectTracker::Draw; CRectTracker::HitTest; CRectTracker::SetCursor; CRectTracker::Track; CScrollView::GetDeviceScrollPosition; CScrollView::SetScrollSizes; CStatusBar::Create; CStatusBar::SetIndicators; CToolBar::Create; CToolBar::LoadBitmap; CToolBar::SetButtons; CView::DoPreparePrinting; CView::GetDocument; CView::IsSelected; CView::OnDragEnter; CView::OnDragLeave; CView::OnDragOver; CView::OnDraw; CView::OnDrop; CView::OnInitialUpdate; CView::OnPrepareDC; CView::OnPreparePrinting; CView::OnScrollBy; CView::OnUpdate; CWinApp::AddDocTemplate; CWinApp::Enable3dControls; CWinApp::EnableShellOpen; CWinApp::InitInstance; CWinApp::LoadStdProfileSettings; CWinApp::RegisterShellFileTypes; CWinApp::RunEmbedded; CWnd::ClientToScreen; CWnd::GetClientRect; CWnd::GetDC; CWnd::GetParentFrame; CWnd::InvalidateRect; CWnd::OnChar; CWnd::OnCreate; CWnd::OnDestroy; CWnd::OnLButtonDblClk; CWnd::OnLButtonDown; CWnd::OnPaletteChanged; CWnd::OnQueryNewPalette; CWnd::OnRButtonDown; CWnd::OnSetCursor; CWnd::OnSetFocus; CWnd::OnSize; CWnd::ReleaseDC; CWnd::SetFocus; CWnd::ShowWindow; CWnd::UpdateWindow; CreateHatchBrush; DeleteItem; DragAcceptFiles; FORMATETC; FillRect; GetDeviceCaps; GetKeyState; GetSysColor; GlobalFree; GlobalLock; GlobalUnlock; LPtoDP; MessageBeep; MulDiv; RGB; RectVisible; RegisterClipboardFormat; ReleaseStgMedium; STGMEDIUM; SelectPalette; SetBkColor; SetBrushOrg; SetMapMode; SetRect; SetTextColor; SetViewportExt; SetWindowExt; abs; afxMemDF; max; memset; min