C
citydawn
Unregistered / Unconfirmed
GUEST, unregistred user!
implementation
{$R *.dfm}
function ReadData(pipenum:integer;recbufferchar;iLen:integer;waittime:integer=-1):integer;stdcall;external'easyusb.dll';
function WriteData(pipenum:integer;sendbufferchar;iLen:integer;waittime:integer=-1):integer;stdcall;external'easyusb.dll';
procedure TForm1.Button2Click(Sender: TObject);
var
sendstr,recstrchar;
sendcount,reccount,sendlenth:integer;
begin
sendstr:='00';
sendlenth:=length(sendstr);
sendcount:=WriteData(1,sendstr,sendlenth);
if sendcount<>-1 then
begin
edit1.Text:='';
recstr:='';
reccount:=ReadData(1,recstr,64);
if reccount<>-1 then
begin
edit1.Text:=recstr;
end;
end;
end;
以上是我的代码
WriteData发送成功,可是接下来接受ReadData却总是失败?不知道为什么?
{$R *.dfm}
function ReadData(pipenum:integer;recbufferchar;iLen:integer;waittime:integer=-1):integer;stdcall;external'easyusb.dll';
function WriteData(pipenum:integer;sendbufferchar;iLen:integer;waittime:integer=-1):integer;stdcall;external'easyusb.dll';
procedure TForm1.Button2Click(Sender: TObject);
var
sendstr,recstrchar;
sendcount,reccount,sendlenth:integer;
begin
sendstr:='00';
sendlenth:=length(sendstr);
sendcount:=WriteData(1,sendstr,sendlenth);
if sendcount<>-1 then
begin
edit1.Text:='';
recstr:='';
reccount:=ReadData(1,recstr,64);
if reccount<>-1 then
begin
edit1.Text:=recstr;
end;
end;
end;
以上是我的代码
WriteData发送成功,可是接下来接受ReadData却总是失败?不知道为什么?