- 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
$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))
;make the DllCall
$ret = DllCall("kernel32.dll","int","GetVersionEx","ptr",DllStructGetPtr($p))
if Not $ret[0] Then
MsgBox(0,"DllCall Error","DllCall Failed")
exit
EndIf
;get the returned values
$major = DllStructGetData($p,"dwMajorVersion")
$minor = DllStructGetData($p,"dwMinorVersion")
$build = DllStructGetData($p,"dwBuildNumber")
$platform = DllStructGetData($p,"dwPlatformId")
$version = DllStructGetData($p,"szCSDVersion")
;free the struct
$p =0
msgbox(0,"","Major: " & $major & @CRLF & _
"Minor: " & $minor & @CRLF & _
"Build: " & $build & @CRLF & _
"Platform ID: " & $platform & @CRLF & _
"Version: " & $version)
Hat jemand ne idee woran das liegen kann?
Gruß
Spider