The ProvideIcon method of the IOlapAddIn interface responds to a request that the add-in program provide an OLE_HANDLE for an icon to be loaded from a resource file for use in the tree view.
Function ProvideIcon(Index As Integer) As stdole.OLE_HANDLE
The ProvideIcon function is called by the OLAP Add-In Manager to load an available icon from a resource file.
Note The resource file attached to the custom add-in program will be referenced only from a compiled DLL. If you run the add-in program from within Microsoft® Visual Basic®, the associated resource file will be bypassed and icons will be loaded from a default resource.
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