Own_Tab UDF Problem

  • Hallo liebe Community,

    Ich bastel gerade an einer GUI und bräuchte etwas Hilfe.
    Ich benutze die Own-Tab UDF von funkey

    Spoiler anzeigen
    [autoit]

    Local $aTabText[3] = ["MS SQL Server", "Email", "MySQL Server"] ;Declare the regions for the OwnTab-control
    Local $aTabIcons[3][2] = [[$icondllpath, 49],[$icondllpath, 44],[$icondllpath, 49]]
    Global $aconfig_TAB = _OwnTab_Create($h_Gui, $aTabText, 220, 65, 629, 385, 25, 0xD5D5D5, 0xFFFFFF, 0xFFFFFF, $aTabIcons)
    #region ### MSSQL Server ###
    _OwnTab_Add($aconfig_TAB) ;Start controls tab1
    GUICtrlCreateLabel($as_language[12], 230, 107, 100, 30, -1, -1)
    _Controlsetview(-1)
    $c_MSSQL_IP = GUICtrlCreateInput("", 340, 100, 170, 30)
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $c_MSSQL_IP = ' & $c_MSSQL_IP & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console

    [/autoit]

    Ich erhalte diesen Fehler:

    [autoit]

    @@ Debug(8103) : $c_MSSQL_IP = 0
    >Error code: 1

    [/autoit]

    Wenn ich nun das Erstellen des Tabs auskommentiere:

    Spoiler anzeigen
    [autoit]

    Local $aTabText[3] = ["MS SQL Server", "Email", "MySQL Server"] ;Declare the regions for the OwnTab-control
    Local $aTabIcons[3][2] = [[$icondllpath, 49],[$icondllpath, 44],[$icondllpath, 49]]
    ;~ Global $aconfig_TAB = _OwnTab_Create($h_Gui, $aTabText, 220, 65, 629, 385, 25, 0xD5D5D5, 0xFFFFFF, 0xFFFFFF, $aTabIcons)
    #region ### MSSQL Server ###
    ;~ _OwnTab_Add($aconfig_TAB) ;Start controls tab1
    GUICtrlCreateLabel($as_language[12], 230, 107, 100, 30, -1, -1)
    _Controlsetview(-1)
    $c_MSSQL_IP = GUICtrlCreateInput("", 340, 100, 170, 30)
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $c_MSSQL_IP = ' & $c_MSSQL_IP & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console

    [/autoit]

    Erhalte ich keinen Fehler.

    Ich weiß nicht woran es liegen könnte, ich kann aber das gesamte Script aus Datenschutzgründen und Länge ( ~10k Zeilen ohne Includes) nicht posten.

    Kann sich jemand das erklären / mir helfen?

  • Das ist ja eben das Problem, ich kriege den Fehler nicht rekonstruiert.

    Hier auch einmal die Funktion _OwnTabCreate

    Spoiler anzeigen
    [autoit]

    Func _OwnTab_Create($hWnd, $aTabText, $xPos, $yPos, $iWidth, $iHeight, $iItemHeight = -1, $nColNoSel = -1, $nColSel = -1, $nColBg = -1, $aIcons = "")
    Local $aSize, $aSize2[UBound($aTabText)][2], $xLast = 0, $aCtrl[UBound($aTabText) + 1][11], $iOffset = 0
    If Not IsArray($aIcons) Then
    Local $Icons[UBound($aTabText)][2]
    Else
    Local $Icons = $aIcons
    EndIf
    If Not IsArray($aTabText) Then Return SetError(1, 0, "")
    For $i = 0 To UBound($aTabText) - 1
    If $aTabText[$i] = "" Then Return SetError(2, $i + 1, "")
    $aSize = _GetTextSize($aTabText[$i])
    $aSize[0] += Ceiling($aSize[0] / 10) ;make it 10% longer for bold text
    $aSize2[$i][0] = $aSize[0]
    $aSize2[$i][1] = $aSize[1]
    If $iItemHeight = -1 Then $iItemHeight = $aSize[1]
    If $Icons[$i][0] <> "" Then
    $iOffset = $iItemHeight
    $aTabText[$i] &= " "
    Else
    $iOffset = 0
    EndIf
    $aCtrl[$i + 1][7] = $Icons[$i][0] ;filename for icon
    $aCtrl[$i + 1][8] = $Icons[$i][1] ;index for icon
    $aCtrl[$i + 1][9] = $aSize[0] + 5 + $iOffset ;labelwidth
    $aCtrl[$i + 1][0] = GUICtrlCreateLabel($aTabText[$i], $xPos + $xLast + 5, $yPos + 2, $aCtrl[$i + 1][9], $iItemHeight, 0x411201 + ($Icons[$i][0] <> ""), $OwnTab_Style)
    _HoverAddCtrl($aCtrl[$i + 1][0])
    If $Icons[$i][0] <> "" Then
    $aCtrl[$i + 1][6] = GUICtrlCreateIcon("", 0, $xPos + $xLast + 8, $yPos + 5, $iItemHeight - 6, $iItemHeight - 6)
    Else
    $aCtrl[$i + 1][6] = GUICtrlCreateDummy()
    EndIf
    ;~ If $Icons[$i][0] <> "" Then _SetBkIcon($aCtrl[$i + 1][6], $nColNoSel, $aCtrl[$i + 1][7], $aCtrl[$i + 1][8], $iItemHeight - 6, $iItemHeight - 6)
    GUICtrlCreateLabel($aCtrl[$i + 1][7], -200, -200) ;For information
    GUICtrlCreateLabel($aCtrl[$i + 1][8], -200, -200) ;For information
    GUICtrlCreateLabel($iItemHeight - 6, -200, -200) ;For information
    $aCtrl[$i + 1][2] = $nColNoSel
    $aCtrl[$i + 1][3] = $nColSel
    $xLast += $aCtrl[$i + 1][9]
    Next
    GUICtrlCreateLabel("", $xPos, $yPos + $iItemHeight, $iWidth, $iHeight, 0x411000, $OwnTab_Style)
    GUICtrlSetState(-1, 128) ;$GUI_DISABLE
    GUICtrlSetBkColor(-1, $nColBg)
    $xLast = 0
    For $i = 0 To UBound($aTabText) - 1
    If $Icons[$i][0] <> "" Then
    $iOffset = $iItemHeight
    Else
    $iOffset = 0
    EndIf
    $aCtrl[$i + 1][1] = GUICtrlCreateLabel("", $xPos + $xLast + 6, $yPos + $iItemHeight - $OwnTab_Style, $aSize2[$i][0] + 3 + $iOffset, 2+2*$OwnTab_Style)
    GUICtrlSetBkColor(-1, $nColSel)
    $xLast += $aSize2[$i][0] + 5 + $iOffset
    Next
    $aCtrl[0][1] = $iItemHeight
    $aCtrl[0][2] = $nColNoSel
    $aCtrl[0][3] = $nColSel
    $aCtrl[0][9] = $yPos + 2
    $hOwnTabGui = $hWnd
    Return $aCtrl
    EndFunc ;==>_OwnTab_Create

    [/autoit]

    In der Funktion wird ein Label erstellt, dies schlägt auch fehl! (Return 0, @error = 1)

    --EDIT--
    Wenn ich vor dem Funktionsaufruf von _OwnTab_Create ein Control erstelle, erhalte ich keinen Fehler, das Control wird erstellt und ich kriege eine ControlID zurück

    --EDIT-- Ich finde keinen Grund, warum das erstellen eines Labels fehlschlagen sollte, wenn es kurz vorher noch funktioniert hat