To clear, or delete, an embedded object, you must:
IDR_CONTRTYPE
menu and assign its command IDThe following procedure explains how to do these tasks.
Note For a refresher on working with the menu editor, complete the procedure outlined in Add the Clear All Command to Scribble's Edit Menu in Scribble Lesson 5.
To delete an embedded object
IDR_CONTRTYPE
menu resource:Edit
...
Paste &Special
-------------
&Delete
-------------
Erase the selection\nErase
(The prompt doesn’t show until you’re out of edit mode for this menu command.)
OnEditClear
as follows:if (m_pSelection != NULL)
{
m_pSelection->Delete();
m_pSelection = NULL;
GetDocument()->UpdateAllViews(NULL);
}
OnUpdateEditClear
as follows:pCmdUI->Enable(m_pSelection != NULL);
To delete an embedded object in a container, simply call the object’s COleClientItem::Delete function.