Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

HOW TO: Access An Event Registration Item From A Store Event Method


View products that this article applies to.

This article was previously published under Q294197

↑ Back to the top


Summary

This step-by-step article describes how to access an event registration item from a store event method.

An event registration item is stored as a hidden item in the folder in which the corresponding event sink is registered, and can be opened as an ActiveX Data Objects (ADO) record. It is possible to obtain the event registration item from within the store event sink.

Access an Event Resigtration Item from a Store Event Method

None of the store events expose the event registration item directly. However, most of them allow access to the URL of the event registration item, which can be used to open an ADO record. The event method that you are using determines how you obtain this URL.

The methods are as follows:
  • OnTimer The URL to the registration item is passed to the OnTimer event as a string. In the following code, the bstrURLItem parameter is the URL to the registration item.
    Private Sub IExStoreSystemEvents_OnTimer( _
                ByVal bstrURLItem As String, _
                ByVal lFlags As Long)
    					
  • OnSave, OnDelete, OnSyncSave, or OnSyncDelete To use one of these methods, follow these steps:

    1. Cast the IExStoreEventInfo pointer that is passed to these events as an IExStoreRegistrationURL item.
    2. Get the URL for the registration item from the EventRegistrationURL property of the IExStoreRegistrationURL item.
      Private Sub IExStoreAsyncEvents_OnSave( _
                  ByVal pEventInfo As Exoledb.IExStoreEventInfo, _
                  ByVal bstrURLItem As String, _
                  ByVal lFlags As Long)
                  
          Dim oRegistrationURL As Exoledb.IExStoreRegistrationURL
          Dim strRegItemURL As String
          
          ' Cast pEventInfo as an IExStoreRegistrationURL item.
          Set oRegistrationURL = pEventInfo
          
          ' Get the EventRegistrationURL property from this item.
          strRegItemURL = oRegistrationURL.EventRegistrationURL
      End Sub
      						
  • OnMDBStartUp or OnMDBShutDown The URL to the registration item is not exposed by anything that is passed to these event methods.

↑ Back to the top


References

↑ Back to the top


Keywords: KB294197, kbmsg, kbhowtomaster, kbhowto

↑ Back to the top

Article Info
Article ID : 294197
Revision : 4
Created on : 2/22/2007
Published on : 2/22/2007
Exists online : False
Views : 245