13,825
社区成员
发帖
与我相关
我的任务
分享
/******************* 下面开始使用动态库 ***********************/
int ret;
AnsiString m_Disp = " china";
unsigned char cmd[2],ack;
cmd[0] = sizeof(sendbuf) / 256; //需要发送的字节数量的长度的高 8 位
cmd[1] = sizeof(sendbuf) % 256; // 低 8 位
//下面是动态库的使用
HINSTANCE handle;
FARPROC lpFarProc;
int __stdcall (*pFun)(int,unsigned char*,int,int);//change
handle = LoadLibrary("zyUSBDev.dll");
lpFarProc = GetProcAddress(handle, "zyUSB_ReadData");
pFun = (int(__stdcall*)(int,unsigned char*,int,int))lpFarProc; //__cdecl
//用逻辑端点2, 接收来自 USB 设备的大量数据