Platform SDK: Active Directory, ADSI, and Directory Services

IDsObjectPicker

The IDsObjectPicker interface enables an application to initialize and display the object picker dialog box.

When to Implement

Applications do not implement the IDsObjectPicker interface. The system implements this interface.

When to Use

Use the IDsObjectPicker interface if you want to display the object picker dialog box. The dialog box enables a user to select objects from the Active Directory™ global catalog, Windows NT/Windows 2000 domains, Windows NT/Windows 2000 computers, and workgroups. The object types from which the user can select include user, contact, group, and computer objects.

To create an instance of the system's IDsObjectPicker implementation, call the CoCreateInstance or CoCreateInstanceEx function as shown in the following sample code:

HRESULT hr = S_OK;
IDsObjectPicker *pDsObjectPicker = NULL;
 
hr = CoCreateInstance(CLSID_DsObjectPicker,
             NULL,
             CLSCTX_INPROC_SERVER,
             IID_IDsObjectPicker,
             (void **) &pDsObjectPicker);

The system's IDsObjectPicker implementation supports both apartment-and free-threading models, and the implementation is thread safe. In practice this means that a call to the Initialize or InvokeDialog method of the interface will block until no other thread of your application is calling the other method on that instance of the interface.

Methods in Vtable Order

IUnknown Methods Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments reference count.
Release Decrements reference count.

IDsObjectPicker Methods

Method Description
Initialize Initializes the interface with information about the scopes, filters, and options used by the dialog box.
InvokeDialog Displays the dialog box and returns the user's selections.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Objsel.h.
  Library: Included as a resource in Objsel.dll.

See Also

CoCreateInstance or CoCreateInstanceEx, Object Picker Dialog Box Interfaces, Object Picker Dialog Box Overview