我用 VC 写了DLL
int APIENTRY SendData(BYTE *data)在 中这样声名
Private Declare Function SendData Lib "**.dll" (ByRef bData As Byte) As Long使用的 时候 出错了
dim aa() as byteaa(0) = &HFF
aa(1) = &HFCSendData(aa)之后程序就over 了
int APIENTRY SendData(BYTE *data)在 中这样声名
Private Declare Function SendData Lib "**.dll" (ByRef bData As Byte) As Long使用的 时候 出错了
dim aa() as byteaa(0) = &HFF
aa(1) = &HFCSendData(aa)之后程序就over 了
而C语言数组实际上是:指向首元素的常量指针Byref的语义是传送变量的地址,所以SendData(aa(0))是将数组首元素地址传了过去