DllStructCreate Array

    • Offizieller Beitrag

    Hallo

    ich hab ein kleines Problem mit DllStructCreate unter Windows 7 und mit AutoIt 3.3.6.0: Wenn ich ein Array mit DllStructCreate definieren will bekomme ich immer ein leeren String (mit DllStructGetData) zurück.
    Auch das offizielle Beispiel von der Hilfe funktioniert bei mir nicht. Er zeigt bei "Version: " immer ein Leerstring (nichts) an (also bei szCSDVersion, das ist ein char[128] Array)

    Spoiler anzeigen
    [autoit]

    $p = DllStructCreate("dword dwOSVersionInfoSize;dword dwMajorVersion;dword dwMinorVersion;dword dwBuildNumber;dword dwPlatformId;char szCSDVersion[128]")

    [/autoit] [autoit][/autoit] [autoit]

    ;think of this as p->dwOSVersionInfoSize = sizeof(OSVERSIONINFO)
    DllStructSetData($p, "dwOSVersionInfoSize", DllStructGetSize($p))

    [/autoit] [autoit][/autoit] [autoit]

    ;make the DllCall
    $ret = DllCall("kernel32.dll","int","GetVersionEx","ptr",DllStructGetPtr($p))

    [/autoit] [autoit][/autoit] [autoit]

    if Not $ret[0] Then
    MsgBox(0,"DllCall Error","DllCall Failed")
    exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ;get the returned values
    $major = DllStructGetData($p,"dwMajorVersion")
    $minor = DllStructGetData($p,"dwMinorVersion")
    $build = DllStructGetData($p,"dwBuildNumber")
    $platform = DllStructGetData($p,"dwPlatformId")
    $version = DllStructGetData($p,"szCSDVersion")

    [/autoit] [autoit][/autoit] [autoit]

    ;free the struct
    $p =0

    [/autoit] [autoit][/autoit] [autoit]

    msgbox(0,"","Major: " & $major & @CRLF & _
    "Minor: " & $minor & @CRLF & _
    "Build: " & $build & @CRLF & _
    "Platform ID: " & $platform & @CRLF & _
    "Version: " & $version)

    [/autoit] [autoit][/autoit] [autoit][/autoit]

    Hat jemand ne idee woran das liegen kann?

    Gruß
    Spider

  • Gibt es etwa schon ein Service-Pack für Win7? Mein XP mit SP3 zeigt hier Service Pack3 ;)

    Zitat

    szCSDVersion
    A null-terminated string, such as "Service Pack 3", that indicates the latest Service Pack installed on the system. If no Service Pack has been installed, the string is empty.

    • Offizieller Beitrag

    Hallo,

    Ja, ich hab ein Service Pack.. warte.. ;) Ne, aber das gleiche Problem hab ich auch bei der RAPI (Active Sync/Windows Mobile/CE API). Bekomme ich auch nur ein leeren String. Aber vielleicht ist dort auch kein Service Pack installiert :P
    Windows ist doch berühmt für seine Fehlermeldungen, warum gibt es hier keine aus?

    Naja, vielen Dank Andy.

    Gruß
    Spider