Sign in to follow this  
Followers 0
cueclub

Snippet troubles

8 posts in this topic

#1 ·  Posted (edited)

I keep getting this error every time i try to add a snippet or recall one

_GUIImageList_AddIcon: -1

I am on windows vista. Using the latest version of AutoIt and have installed the full editor. Has anyone had a problem with this and How have you fixed it.

Thanks

Cue

Edited by cueclub

Share this post


Link to post
Share on other sites



I haven't used the snippet holder yet, I just tried it in my copy of SciTE (ver. 1.78), and a dialog comes up with that message too.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I looked in the bug section and in the forums , the bug section had been closed with no reason other then it works for them, and there was no reply on the other forum( ah crap I just told on myself for double posting ) . Weird.

Thanks snowmaker for trying it on yours. So I at least know I am not crazy :(

Edited by cueclub

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

syntax example is:

_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 110)

From the UDFs3.chm Helpfile:

#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

_Main()

Func _Main()
    Local $listview, $hImage
    Local $exStyles = BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES)
    
    GUICreate("ImageList AddIcon", 400, 300)
    $listview = GUICtrlCreateListView("", 2, 2, 394, 268, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT))
    _GUICtrlListView_SetExtendedListViewStyle($listview, $exStyles)
    GUISetState()
    
    ; Load images
    $hImage = _GUIImageList_Create(16, 16, 5, 3)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 110)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 131)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 165)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 168)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 137)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 146)
    _GUICtrlListView_SetImageList($listview, $hImage, 1)

    ; Add columns
    _GUICtrlListView_AddColumn($listview, "Column 1", 120)
    _GUICtrlListView_AddColumn($listview, "Column 2", 100)
    _GUICtrlListView_AddColumn($listview, "Column 3", 100)

    ; Add items
    _GUICtrlListView_AddItem($listview, "Row 1: Col 1", 0)
    _GUICtrlListView_AddSubItem($listview, 0, "Row 1: Col 2", 1, 1)
    _GUICtrlListView_AddSubItem($listview, 0, "Row 1: Col 3", 2, 2)
    _GUICtrlListView_AddItem($listview, "Row 2: Col 1", 1)
    _GUICtrlListView_AddSubItem($listview, 1, "Row 2: Col 2", 1, 2)
    _GUICtrlListView_AddItem($listview, "Row 3: Col 1", 2)
    _GUICtrlListView_AddItem($listview, "Row 4: Col 1", 3)
    _GUICtrlListView_AddItem($listview, "Row 5: Col 1", 4)
    _GUICtrlListView_AddSubItem($listview, 4, "Row 5: Col 2", 1, 3)
    _GUICtrlListView_AddItem($listview, "Row 6: Col 1", 5)
    _GUICtrlListView_AddSubItem($listview, 5, "Row 6: Col 2", 1, 4)
    _GUICtrlListView_AddSubItem($listview, 5, "Row 6: Col 3", 2, 3)

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main
Edited by ripdad

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites

ok a little more description for the noob of the group ( me ).

What does all that mean?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

_GUIImageList_AddIcon($hImage, @SystemDir & "shell32.dll", 110)

_GUIImageList_AddIcon() = the function you are using

$hImage = the gui control you are adding it to

@SystemDir & "shell32.dll" = the path to the icon or dll that contains the icon

110 = the icon number inside the dll

- edit -

If you use your own icon - then it would look like this:

_GUIImageList_AddIcon($hImage, @ScriptDir & "someicon.ico")

Edited by ripdad

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites

are you serious? Soooooooo what does that have to do with me not being able to use my add snippet or insert in the program like it was intended? Works fine in XP ( just tested ) But not in vista. That was the original question.

Wasn't expecting what you had posted.

And then me asking what all of that means was not asking to decipher the line.

but thanks

Share this post


Link to post
Share on other sites

okay :(


"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0