ProvideIcon

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.

Syntax

Function ProvideIcon(Index As Integer) As stdole.OLE_HANDLE

Calling Arguments
Index
The requested index for the icon resource.
Remarks

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.


Example

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

 

(c) 1988-1998 Microsoft Corporation. All Rights Reserved.