The DestroyElement method removes the specified storage or stream from this storage object.
HRESULT DestroyElement( const OLECHAR *pwcsName );
A pointer to a wide character null-terminated Unicode string that contains the name of the storage or stream to be removed.
This method can return one of these values.
The DestroyElement method deletes a substorage or stream from the current storage object. After a successful call to DestroyElement, any open instance of the destroyed element from the parent storage becomes invalid.
If a storage object is opened in the transacted mode, destruction of an element requires that the call to DestroyElement be followed by a call to IStorage::Commit.
For content streams, the deleted stream sectors are marked as free. If the free sectors are at the end of the file, the document file should shrink. To compact a document file, call IStorage::CopyTo on the root storage object and copy to a new storage object.
|Minimum supported client||Windows 2000 Professional [desktop apps | UWP apps]|
|Minimum supported server||Windows 2000 Server [desktop apps | UWP apps]|