Compartir a través de


CUtlProps::OnInterfaceRequested

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CUtlProps::OnInterfaceRequested.

Handles requests for an optional interface when a consumer calls a method on one of the object creation interfaces.

Syntax

  
      virtual HRESULT CUtlPropsBase::OnInterfaceRequested(  
   REFIID riid  
);  

Parameters

riid
[in] The IID for the requested interface. For more details, see the description of the riid parameter of ICommand::Execute in the OLE DB Programmer's Reference (in the MDAC SDK).

Remarks

OnInterfaceRequested handles consumer requests for an optional interface when a consumer calls a method on one of the object creation interfaces (such as IDBCreateSession, IDBCreateCommand, IOpenRowset, or ICommand). It sets the corresponding OLE DB property for the requested interface. For example, if the consumer requests IID_IRowsetLocate, OnInterfaceRequested sets the DBPROP_IRowsetLocate interface. Doing so maintains the correct state during rowset creation.

This method is called when the consumer calls IOpenRowset::OpenRowset or ICommand::Execute.

If a consumer opens an object and requests an optional interface, the provider should set the property associated with that interface to VARIANT_TRUE. To allow property-specific processing, OnInterfaceRequested is called before the provider's Execute method is called. By default, OnInterfaceRequested handles the following interfaces:

  • IRowsetLocate

  • IRowsetChange

  • IRowsetUpdate

  • IConnectionPointContainer

  • IRowsetScroll

If you wish to handle other interfaces, override this function in your data source, session, command, or rowset class to process functions. Your override should go through the normal set/get properties interfaces to ensure that setting properties also sets any chained properties (see OnPropertyChanged).

Requirements

Header: atldb.h

See Also

CUtlProps Class