IPropertyPage::SetObjects method

Provides the property page with an array of pointers to objects associated with this property page.

When the property page receives a call to IPropertyPage::Apply, it must send value changes to these objects through whatever interfaces are appropriate. The property page must query for those interfaces. This method can fail if the objects do not support the interfaces expected by the property page.


HRESULT SetObjects(
  [in] ULONG    cObjects,
  [in] IUnknown **ppUnk


cObjects [in]

The number of pointers in the array pointed to by ppUnk. If this parameter is 0, the property page must release any pointers previously passed to this method.

ppUnk [in]

A pointer to an array of IUnknown interface pointers where each pointer identifies a unique object affected by the property sheet in which this (and possibly other) property pages are displayed. The property page must cache these pointers calling AddRef for each pointer at that time. This array of pointers is the same one that was passed to OleCreatePropertyFrame or OleCreatePropertyFrameIndirect to invoke the property sheet.

Return value

This method can return the standard return values E_FAIL, E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following values.

Return codeDescription

The property page successfully saved the pointers it needed.


One of the objects in ppUnk did not support the interface expected by this property page, and so this property page cannot communicate with it.


The address in ppUnk is not valid. For example, it may be NULL.



The property page is required to keep the pointers returned by this method or others queried through them. If these specific IUnknown pointers are held, the property page must call AddRef through each when caching them, until the time when SetObjects is called with cObjects equal to 0. At that time, the property page must call Release through each pointer, releasing any objects that it held.

The caller must provide the property page with these objects before calling IPropertyPage::Activate, and should call SetObjects with zero as the parameter when deactivating the page or when releasing the object entirely. Each call to SetObjects with a non-NULLppUnk parameter must be matched with a later call to SetObjects with 0 in the cObjects parameter.

Notes to Implementers

E_NOTIMPL is not a valid return value.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]






IID_IPropertyPage is defined as B196B28D-BAB4-101A-B69C-00AA00341D07

See also