Jump to content

Error in GuiCombo.au3


Recommended Posts

Hi,

with autoit-v3.2.4.0 i become a Error with _GUICtrlComboAutoComplete.

Also in the example Script.

Error:

C:\PROGRA~1\AutoIt3\Include\GuiCombo.au3 (558) : ==> Variable must be of type "Object".:

$s_text = $struct.Text

$s_text = $struct^ ERROR

Srcipt:

#include <GuiConstants.au3>
#include <GuiCombo.au3>

Opt ('MustDeclareVars', 1)

Dim $Combo, $Btn_Exit, $msg, $old_string = ""

GUICreate("ComboBox AutoComplete", 392, 254)

$Combo = GUICtrlCreateCombo("", 70, 100, 270, 120)
GUICtrlSetData($Combo, "AutoIt|v3|is|freeware|BASIC-like|scripting|language|Autobot|Animal")
$Btn_Exit = GUICtrlCreateButton("Exit", 150, 180, 90, 30)
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
            ExitLoop
        Case Else
            _GUICtrlComboAutoComplete ($Combo, $old_string)
    EndSelect
WEnd
Exit

greeting

Frank

Link to comment
Share on other sites

Hi,

with autoit-v3.2.4.0 i become a Error with _GUICtrlComboAutoComplete.

Also in the example Script.

Error:

C:\PROGRA~1\AutoIt3\Include\GuiCombo.au3 (558) : ==> Variable must be of type "Object".:

$s_text = $struct.Text

$s_text = $struct^ ERROR

Srcipt:

#include <GuiConstants.au3>
#include <GuiCombo.au3>

Opt ('MustDeclareVars', 1)

Dim $Combo, $Btn_Exit, $msg, $old_string = ""

GUICreate("ComboBox AutoComplete", 392, 254)

$Combo = GUICtrlCreateCombo("", 70, 100, 270, 120)
GUICtrlSetData($Combo, "AutoIt|v3|is|freeware|BASIC-like|scripting|language|Autobot|Animal")
$Btn_Exit = GUICtrlCreateButton("Exit", 150, 180, 90, 30)
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
            ExitLoop
        Case Else
            _GUICtrlComboAutoComplete ($Combo, $old_string)
    EndSelect
WEnd
Exit

greeting

Frank

No error for me. Get the latest versions.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I use autoit-v3.2.4.0 (This is the last Version)

I have a new clean Windows XP

Edit:

the Error comes only with GuiCombo.au3 from 07.05.2007

not from 19.12.2006.

07.05.2007

Func _GUICtrlComboGetLBText($h_combobox, $i_index, ByRef $s_text)
    If Not _IsClassName ($h_combobox, "ComboBox") Then Return SetError($CB_ERR, $CB_ERR, $CB_ERR)
    Local $len = _GUICtrlComboGetLBTextLen($h_combobox, $i_index)
    
    $s_text = ""
    Local $ret, $struct = DllStructCreate("char Text[" & $len + 1 & "]")
    If Not IsHWnd($h_combobox) Then $h_combobox = GUICtrlGetHandle($h_combobox)
    $ret = DllCall("user32.dll", "int", "SendMessageA", "hwnd", $h_combobox, "int", $CB_GETLBTEXT, "int", $i_index, "ptr", DllStructGetPtr($struct))
    If ($ret[0] == $CB_ERR) Then Return SetError($CB_ERR, $CB_ERR, $CB_ERR)
    $s_text = $struct.Text
    Return $ret
EndFunc ;==>_GUICtrlComboGetLBText

19.12.2006

Func _GUICtrlComboGetLBText($h_combobox, $i_index, ByRef $s_text)
    Local $len = _GUICtrlComboGetLBTextLen($h_combobox, $i_index)
    
    $s_text = ""
    Local $p, $ret
    $p = DllStructCreate("char[" & $len + 1 & "]")
    If IsHWnd($h_combobox) Then
        Local $a_ret = DllCall("user32.dll", "int", "SendMessage", "hwnd", $h_combobox, "int", $CB_GETLBTEXT, "int", $i_index, "ptr", DllStructGetPtr($p))
        If ($a_ret[0] == $CB_ERR) Then Return SetError($CB_ERR,$CB_ERR,$CB_ERR)
    Else
        $ret = GUICtrlSendMsg($h_combobox, $CB_GETLBTEXT, $i_index, DllStructGetPtr($p))
        If ($ret == $CB_ERR) Then Return SetError($CB_ERR,$CB_ERR,$CB_ERR)
    EndIf
    $s_text = DllStructGetData($p, 1)
    Return $ret
EndFunc ;==>_GUICtrlComboGetLBText

Edit:

This is a Bug.

Read this Post http://www.autoitscript.com/forum/index.php?showtopic=45788

Edited by Thunder-man
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...