1,486
社区成员
发帖
与我相关
我的任务
分享
int RunSeries(unsigned char* lpszScrColorImg, int height,int width,int mode, LEUCCYTO1 LeucChar[]);
//参数 LeucChar 作为数组,数组由谁创建?数组长度多少?
typedef struct {
...
unsigned char rgb[3]; //数组长度为4
...
}LEUCCYTO1;
Public Type LEUCCYTO1
...
rgb(0 To 3) As Byte '长度要一致,下标遵循C标准比较方便
...
End Type
'注:VB中不支持语句内注释,使用时将下面的注释去除后拼成一句
Declare Function RunSeries Lib "HemanalyDll4.dll" '尽量不用绝对路径,只有保证dll在exe同目录或系统目录下就可以了
( ByRef lpszScrColorImg As byte, '传递字节数组用这种定义比较方便
ByVal height As Long, ByVal width As Long, ByVal mode As Long, '传值一律用 ByVal
ByRef lpLeucChar As LEUCCYTO1 '假定该数组由调用者创建,长度已约定
) As Long
'调用
dim buff(0 to 2359296-1) as byte
dim LeucChar1(0 to 约定长度-1) as LEUCCYTO1
I = RunSeries(buff(0), 768, 1024, 0, LeucChar1(0)) '注意:用Byref的声明和采用数组首元素作为参数,对应C中的指针/数组