Declare Function CH341WriteRead Lib "CH341DLL.DLL" (ByVal iIndex As Long, ByVal iWriteLength As Long, ByRef iWriteBuffer As Any, ByVal iReadStep As Long, ByVal iReadTimes As Long, ByRef oReadLength As Long, ByRef oReadBuffer As Any) As Boolean ' CH341WriteRead 執(zhí)行數(shù)據(jù)流命令,先輸出再輸入 ' iIndex, 指定CH341設(shè)備序號(hào) ' iWriteLength, 寫長(zhǎng)度,準(zhǔn)備寫出的長(zhǎng)度 ' iWriteBuffer, 指向一個(gè)緩沖區(qū),放置準(zhǔn)備寫出的數(shù)據(jù) ' iReadStep, 準(zhǔn)備讀取的單個(gè)塊的長(zhǎng)度, 準(zhǔn)備讀取的總長(zhǎng)度為(iReadStep*iReadTimes) ' iReadTimes, 準(zhǔn)備讀取的次數(shù) ' oReadLength, 指向長(zhǎng)度單元,返回后為實(shí)際讀取的長(zhǎng)度 ' oReadBuffer 指向一個(gè)足夠大的緩沖區(qū),用于保存讀取的數(shù)據(jù)
在VB,這個(gè)函數(shù)中(iWriteBuffer, 指向一個(gè)緩沖區(qū),放置準(zhǔn)備寫出的數(shù)據(jù)),如何在調(diào)用該函數(shù)時(shí)初始化一個(gè)一維數(shù)組賦值給iWriteBuffer進(jìn)行輸出?謝謝