Hey, I have a custom visio tool bar and i have created a custom .ico file that i want displayed on it
the ToolBarItem class has a .IconFileName method that supports a string file path and loads the icon just fine. However, due to deployment issues i would like to have the file loaded from a resource file (.res). I tried this:
VB Code:
  1. Dim oToolBarItem as ToolBarItem
  2. Set oToolBarItem = oToolBarItems.Add
  3. With oToolBarItem
  4.        'bunch of other stuff, then:
  5.        Dim pic As IPictureDisp
  6.        Set pic = LoadResPicture("ALERT", 1)
  7.        SavePicture pic, "C:\ALERT.ICO"
  8.       .IconFileName "C:\ALERT.ICO"
the code runs fine without erroring, but the icon just shows up as a black square! Also the root directory is obviously a bad place to save the icon to and load it, how would i go about accessing a folder under the application path? Is there a better way to do this without saving and loading a file? any help would be wonderful, thanks!