Jump to content

_GUICtrlComboBoxEx_AddString an 64bit


Recommended Posts

Hi,

i have a problem with _GUICtrlComboBoxEx_AddString on a 64bit Win7.

When i run this script in x86 mode, everything ist fine. But when i run it native (x64), the Script crashes... i figured out, that it is caused by

_GUICtrlComboBoxEx_AddString...

Is this a bug? Or am i missing something? Thank you >_<

#include <GuiComboBoxEx.au3>
#include <GuiImageList.au3>
#include <GuiConstantsEx.au3>

Opt('MustDeclareVars', 1)

$Debug_CB = False ; Check ClassName being passed to ComboBox/ComboBoxEx functions, set to True and use a handle to another control to see it work
If @OSArch = "X64" Then DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
_Main()

Func _Main()
    Local $hGUI, $hImage, $hCombo


    ; Create GUI
    $hGUI = GUICreate("ComboBoxEx Add String", 400, 300)
    $hCombo = _GUICtrlComboBoxEx_Create ($hGUI, "", 2, 2, 394, 100)
    GUISetState()

    $hImage = _GUIImageList_Create (16, 16, 5, 3)
    _GUIImageList_AddIcon($hImage, @ScriptDir & "\icons\mon_on.ico", 0)
    _GUIImageList_AddIcon($hImage, @ScriptDir & "\icons\mon_game.ico", 0)
    _GUIImageList_AddIcon($hImage, @ScriptDir & "\icons\mon_off.ico", 0)
    _GUICtrlComboBoxEx_SetImageList ($hCombo, $hImage)


    _GUICtrlComboBoxEx_BeginUpdate ($hCombo)

    _GUICtrlComboBoxEx_AddString($hCombo, "Work", 0, 0, 0)
    _GUICtrlComboBoxEx_AddString($hCombo, "Game", 1, 1, 1)
    _GUICtrlComboBoxEx_AddString($hCombo, "Crash", 2, 2, 2)
    _GUICtrlComboBoxEx_EndUpdate ($hCombo)

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>_Main
Link to comment
Share on other sites

Hi tried a bit more, a the script crashes even with this code (in x64; x86 works fine):

#include <GuiComboBoxEx.au3>
#include <GuiConstantsEx.au3>

$Debug_CB = True ; Check ClassName being passed to ComboBox/ComboBoxEx functions, set to True and use a handle to another control to see it work

$hGUI = GUICreate("ComboBoxEx Add String", 400, 300)
$hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 2, 2, 394, 100)
GUISetState()

_GUICtrlComboBoxEx_BeginUpdate($hCombo)
_GUICtrlComboBoxEx_AddString($hCombo, "Work")
_GUICtrlComboBoxEx_AddString($hCombo, "Game")
_GUICtrlComboBoxEx_AddString($hCombo, "Crash")
_GUICtrlComboBoxEx_EndUpdate($hCombo)

Do
    Sleep(50)
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Scite gives this output (beta):

>Running:(3.3.1.1):C:\Program Files\System und Tools\AutoIt\beta\autoit3_x64.exe "C:\Program Files\System und Tools\Shell Extension\SysControl\64bit\Problem.au3"    
!===========================================================
+======================================================
-->Line(0182):  This is for debugging only, set the debug variable to false before submitting
+======================================================
!===========================================================
+======================================================
-->Line(0182):  This is for debugging only, set the debug variable to false before submitting
+======================================================
!===========================================================
+======================================================
-->Line(0182):  This is for debugging only, set the debug variable to false before submitting
+======================================================
!===========================================================
+======================================================
-->Line(0182):  This is for debugging only, set the debug variable to false before submitting
+======================================================
!>10:46:04 AutoIT3.exe ended.rc:-1073740771
+>10:46:06 AutoIt3Wrapper Finished
>Exit code: -1073740771    Time: 1.799
Link to comment
Share on other sites

  • 1 month later...

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...