# IPerPropertyBrowsing interface
{: .no_toc }

Lets a property browser ask an object for the display string, the property page and the predefined values of one of its properties.

**IPerPropertyBrowsing** has the interface identifier `376BD3AA-3845-101B-84ED-08002B2EC713` and extends **stdole.IUnknown**. It is declared `[OleAutomation(False)]`. Microsoft Learn describes the Windows interface: [IPerPropertyBrowsing](https://learn.microsoft.com/en-us/windows/win32/api/ocidl/nn-ocidl-iperpropertybrowsing).

The declaration is complete: it has all four methods of the Windows interface, and every one is marked `[PreserveSig]`. Each returns the raw HRESULT as a **Long**; `E_NOTIMPL` (`&H80004001`) means that the object does not provide that kind of information. A class cannot implement this interface; it is for calling. [IPerPropertyBrowsingVB](/tB/Packages/Contributed/OLEGuids/IPerPropertyBrowsingVB.md) declares three of the methods in a form a class can implement.

Each property is named by its dispatch identifier, *DispId*.

## Methods

### GetDisplayString

```tb inert=signature
[PreserveSig]
Function GetDisplayString(ByVal DispId As Long, ByRef lpDisplayName As LongPtr) As Long
```

Returns a text string that describes a property, for a property browser to display. *lpDisplayName* receives a pointer to a `BSTR` that the object allocates. The caller frees it with `SysFreeString`.

### MapPropertyToPage

```tb inert=signature
[PreserveSig]
Function MapPropertyToPage(ByVal DispId As Long, ByRef pCLSID As OLEGuids.OLECLSID) As Long
```

Returns the class identifier of the property page on which the property can be edited, in *pCLSID*. When the method fails, *pCLSID* is set to the null identifier.

### GetPredefinedStrings

```tb inert=signature
[PreserveSig]
Function GetPredefinedStrings(ByVal DispId As Long, ByRef pCaStringsOut As OLEGuids.OLECALPOLESTR, ByRef pCaCookiesOut As OLEGuids.OLECADWORD) As Long
```

Returns the names of the values a property can take, for a drop-down list. *pCaStringsOut* receives a counted array of string pointers, and *pCaCookiesOut* a counted array of cookies. Each string has a cookie in the same position. The object allocates the strings and both arrays, and the caller frees them with `CoTaskMemFree`. A cookie is passed to **GetPredefinedValue** to get the value the string names.

### GetPredefinedValue

```tb inert=signature
[PreserveSig]
Function GetPredefinedValue(ByVal DispId As Long, ByVal dwCookie As Long, ByRef pVarOut As Variant) As Long
```

Returns, in *pVarOut*, the value that corresponds to *dwCookie*, a cookie that **GetPredefinedStrings** returned.

## See Also

- [IPerPropertyBrowsingVB](/tB/Packages/Contributed/OLEGuids/IPerPropertyBrowsingVB.md) interface -- Visual Basic-style versions of three of the methods
- [ISpecifyPropertyPages](/tB/Packages/Contributed/OLEGuids/ISpecifyPropertyPages.md) interface -- lists the property pages of an object
- [OLECLSID](/tB/Packages/Contributed/OLEGuids/OLECLSID.md) type -- a class or interface identifier
- [OLECALPOLESTR](/tB/Packages/Contributed/OLEGuids/OLECALPOLESTR.md) type -- a counted array of Unicode string pointers
- [OLECADWORD](/tB/Packages/Contributed/OLEGuids/OLECADWORD.md) type -- a counted array of **DWORD** values
