February 22, 1999
CEdit is an MFC-based MDI application that demonstrates how to host the DHTML Editing DocObject.
To use the libraries, follow the instructions on how to set up the order of header file and library paths on the Welcome to Site Builder Network Workshop Tools & Samples Download Area page.To open the CEdit application for editing in Visual C++
Although none of the hosting code for the DHTML Editing DocObject makes use of MFC, MFC was used to supply the basis for the MDI application, and for the toolbar, status bar, message handling, and so forth.
CEdit supplies its own toolbar and menus and uses the IOleCommandTarget interface to exchange status and command information with the DHTML Editing Component DocObject. The CEdit sample also illustrates how to access and use the document object model (DOM), which allows you to modify any part of the document. For example, CEdit uses the DOM to set the background color of the current document.
The CEdit sample also demonstrates how to sink document events. For example, CEdit traps the mousedown event and retrieves the corresponding x, y coordinates of the event in its event sink implementation. The same technique can be applied to listen to any events that can be trapped in script on an HTML page. In this example, the code to set the event sink is in the method CCEditView::Connect()in the file Crtview.cpp. The implementation of the event sink is in the file Docevent.cpp.
Note The CEdit sample does not include support for Browse mode.Back to top
© 1999 Microsoft Corporation. All rights reserved.