ProvideIcon (IOlapAddIn Interface)

Analysis Services Programming

Analysis Services Programming

ProvideIcon (IOlapAddIn Interface)

The ProvideIcon method of the IOlapAddIn interface is called by the Microsoft OLAP Services Add-Ins Manager library to load an available icon from a resource file.

Syntax

Function ProvideIcon(Index As Integer) As OLE_HANDLE

Index

The requested index for the icon resource.

Remarks

This method responds to a request for an OLE_HANDLE that contains the handle of an icon to be used for a tree node in Analysis Manager. If an icon handle is supplied, the icon is then loaded for use in the tree pane. If no icon handle is supplied, the icon is then loaded from a default resource file.

Example

The following code adds an icon to the tree pane:

Private Const FirstIconID = 1
Private Const LastIconID = 4
'Other code

Private Function IOlapAddIn_ProvideIcon(Index As Integer) _
    As stdole.OLE_HANDLE
  On Error GoTo ProvideIcon_Err 'Handle errors
  If Index >= FirstIconID Or Index <= LastIconID Then
    IOlapAddIn_ProvideIcon = LoadResPicture(Index, vbResIcon)
  End If
  Exit Function
ProvideIcon_Err:
  MsgBox "ProvideIcon failed"
  Err.Clear
End Function
 

See Also

IOlapAddIn Interface