Called by a store when an item is being deleted.
EXOLEDB Type Library
DLL Implemented In
[Visual Basic]Sub OnSyncDelete( pEventInfo As IExStoreEventInfo, bstrURLItem As String, lFlags As LONG)
[C++]HRESULT OnSyncDelete ( IExStoreEventInfo* pEventInfo, BSTR bstrURLItem, LONG lFlags );
- A pointer to an IExStoreEventInfo Interface that can be used to obtain additional information related to the event.
- A string containing a URL to the item that will be deleted upon successful completion of all synchronous events. When the transaction is open, this variable is unlocked.
- The following (bitwise AND) flags can give you further information about the delete event:
Decimal Equivalent C++ Enum Equivalent Meaning 2 EVT_IS_COLLECTION The item being deleted is a collection. 4 EVT_REPLICATED_ITEM The item is being replicated from another location. 16 EVT_SOFTDELETE The item has been moved to the Recycle Bin (soft delete). 32 EVT_HARDDELETE The item has left the store message database (MDB) (hard delete). 256 EVT_MOVE The item was moved, resulting in an implicit delete. 64 EVT_INITNEW This flag is set at the first firing of the event. (This is useful for initialization purposes. It is set only once during the lifetime of a created event sink.) 33554432 EVT_SYNC_COMMITTED Synchronous committed event. 67108864 EVT_SYNC_ABORTED Synchronous aborted event. 1073741824 EVT_INVALID_URL The URL passed to the sink is invalid. 2147483648 EVT_ERROR An error occurred in the event.
Returns S_OK if successful, or an error value otherwise.
To register for this event, you need to set the registration item's EventMethod Field property to "OnSyncDelete" (C++ constant = EVT_ON_SYNC_DELETE).
This event supports the following properties of Event Registration Items:
This event is fired when an item is deleted from the store, or when an item is moved in the store. This event is not fired when the item's parent folder is moved or deleted.
The OnDelete event uses the EVT_HARDDELETE and EVT_SOFTDELETE flags to distinguish between hard and soft deletes. A soft delete is defined as a delete that moves an item into the Recycle Bin. A hard delete is defined as a delete in which an item is completely removed from the store.
Aborting the transaction associated with this event will prevent the item from being deleted. If you abort an event that is the result of a move, then both the save and delete steps of the move will be aborted. This means that the original item will not be deleted and the new item will not be saved.