欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

基 礎(chǔ) 函 數(shù) 參 考


DllStructGetData

返回數(shù)據(jù)結(jié)構(gòu)元素的數(shù)據(jù).

DllStructGetData ( 結(jié)構(gòu), 元素 [, 索引] )

參 數(shù)

結(jié)構(gòu) 由 DllStructCreate 返回的數(shù)據(jù)結(jié)構(gòu).
元素 要訪問的數(shù)據(jù)結(jié)構(gòu)元素, 起始于 1 或由 DllStructCreate 函數(shù)定義的元素名.
索引 [可選參數(shù)] 對于數(shù)組元素,需指定基于 1 的元素索引.
如果省略或 Default(默認(rèn))關(guān)鍵字, 則檢索整個數(shù)組 (用于快速檢索字符串).
不用于非數(shù)組元素
*char[n], byte[n] 與 ubyte[n] 省略索引時, 返回所有元素數(shù)據(jù).

返 回 值

成功: 返回數(shù)據(jù)結(jié)構(gòu)的元素數(shù)據(jù).
失敗: 返回 0.
@Error: 0 = 無錯誤.
1 = DllStructCreate 函數(shù)返回的數(shù)據(jù)結(jié)構(gòu)不正確.
2 = 元素值超出范圍.
3 = 索引值在數(shù)據(jù)結(jié)構(gòu)外面.
4 = 元素的數(shù)據(jù)類型未知
5 = 索引 <= 0.

備 注

當(dāng)元素為 char[n], 并且索引被省略時,返回的數(shù)據(jù)是字符串,
當(dāng)元素為 byte[n] 或 ubyte[n], 并且索引被省略時,返回二進(jìn)制數(shù)據(jù)類型,
否則它總是返回一個數(shù)字.

相 關(guān) 函 數(shù)

DllStructCreate, DllStructSetData

函 數(shù) 示 例


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

;請想象為這樣(C++樣式):  p->dwOSVersionInfoSize = sizeof(OSVERSIONINFO)
DllStructSetData($p, "dwOSVersionInfoSize", DllStructGetSize($p))

;生成 DllCall
Local $ret = DllCall("kernel32.dll", "int", "GetVersionEx", "ptr", DllStructGetPtr($p))

If Not $ret[0] Then
    MsgBox(0, "DllCall 錯誤", "DllCall 失敗")
    Exit
EndIf

;獲取返回值
Local $major = DllStructGetData($p, "dwMajorVersion")
Local $minor = DllStructGetData($p, "dwMinorVersion")
Local $build = DllStructGetData($p, "dwBuildNumber")
Local $platform = DllStructGetData($p, "dwPlatformId")
Local $version = DllStructGetData($p, "szCSDVersion")

;釋放數(shù)據(jù)結(jié)構(gòu)占用的內(nèi)存
$p = 0

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


provider with jb51.net (unicode)