Dual Interfaces

Use COM interfaces to access the properties and methods on any provider ADSI objects. A read-only property maps to an interface entry of the form get_<PropertyName>. A read/write property maps to two interface entries of the form get_<PropertyName> and put_<PropertyName>.

All methods on a COM interface must:

  • Return an HRESULT value to indicate success or failure. The HRESULT type is discussed in the COM specification.
  • On calls to QueryInterface, return E_NOINTERFACE for unimplemented interfaces.
  • Return E_NOTIMPL for unimplemented methods on interfaces that are otherwise implemented.
  • Return E_ADS_PROPERTY_NOT_SUPPORTED for interface properties that are not supported.

To retain compatibility with Automation controllers, all parameters and return types should be within the subset defined by the Automation VARIANT data type. For more information, see VARIANT and VARIANTARG in the Platform Software Development Kit (SDK).

A provider Active Directory object can expose interfaces that use data types other than those in the VARIANT subset. However, Automation controllers such as Visual Basic are not able to call those interfaces. Most ADSI provider interfaces are derived from IDispatch and can be used as IDispatch interface pointers. However, the IDirectoryObject, IDirectorySearch, and IADsExtension ADSI interfaces are not derived from IDispatch.

 

 

Show: