sum.DLL中部份代码:
自定义的结构体
struct tData 
{
int icount;
int* piReadBuf;
int* piReadLen;
};void WINAPI test(tData *t)
{
int i, j = *t->piReadLen;
for (i = 0; i < j; i++)
{
t->piReadBuf[i] = (i + 1) + (t->icount);
}
}VB中部份代码:
与DLL中相对应的结构体(在标准模块中定义的)
Type tdata
    i As Long
    ReadBuf(351) As Long
    ReadLen As Long
End Type声明
Declare Sub test Lib "sum.dll" (tt As tdata)
Private Sub Command1_Click()
    Dim t As tdata    t.icount = 10
    t.ReadLen = 352
    Call test(t)
    
    Print t.ReadBuf(20)
End Sub为什么在VB中一运行,程序就挂掉呢?