有沒有高手幫我看下delphi代碼問題 總是在報錯 急急急!!!
uj5u.com熱心網友回復:
代碼呢?神龍乎uj5u.com熱心網友回復:
忘了貼代碼啦uj5u.com熱心網友回復:
function Readserver92(var st,et:pchar):Tparm;stdcall;var
refRead_Guest_Card92:TRead_Guest_Card92;
refTReader_Alarm92:TReader_Alarm92;
bReaderType, bSectorNo: Byte;
pHotelPwd: PChar;
tmpCardNo, tmpGuestSN, tmpGuestIdx,
ret: Integer;
tmpDoorID, tmpSuitDoor, tmpPubDoor,
tmpBeginTime, tmpEndTime: PChar;
tmpClientID: Longword;
stime,etime:string;
begin
Readserver92.RoomNo:=-1;
Readserver92.CardNo:=-1;
Readserver92.STime:='';
Readserver92.Etime:='';
Readserver92.DATA:='';
Readserver92.BuildNo:=-1;
Readserver92.FloorNo:=-1;
Readserver92.Port:=1;
handle92:=loadlibrary(dllname92);
showmessage(inttostr(handle92));
if handle92>32 then
begin
refRead_Guest_Card92:=GetProcAddress(handle92,readcard92);
bReaderType:=2;//1:RW-21;2:RW-33;3:RW-26B;4:RW-41
bSectorNo:=0;//MF1S50卡使用扇區號(范圍0------15)
strPcopy(pHotelPwd,'123560');
tmpClientID:=376566442;
GetMem(tmpDoorID, 7);
tmpDoorID[6] := #0;
GetMem(tmpSuitDoor, 5);
tmpSuitDoor[4] := #0;
GetMem(tmpPubDoor, 9);
tmpPubDoor[8] := #0;
GetMem(tmpBeginTime, 13);
tmpBeginTime[12] := #0;
GetMem(tmpEndTime, 13);
tmpEndTime[12] := #0;
showmessage(inttostr(iport));
ret := refRead_Guest_Card92(iPort,bReaderType, bSectorNo,
pHotelPwd, tmpClientID,tmpCardNo, tmpGuestSN, tmpGuestIdx, @tmpDoorID[0], @tmpSuitDoor[0],
@tmpPubDoor[0], @tmpBeginTime[0], @tmpEndTime[0]);
if ret<>0 then
begin
errprop92(ret);
strcopy(st,'1900-01-01 00:00');
strcopy(et,'1900-01-01 00:00');
end
else
begin
refTReader_Alarm92:=GetProcAddress(handle92,Reader_Alarm);
refTReader_Alarm92(iport,bReaderType,1);
with DMdll.ADOYuanChuang do
begin
close;
commandtext:='select vcroomcode from jb_lock where vclockcode='''+strPas(tmpDoorID)+'''';
open;
if not isempty then
begin
Readserver92.RoomNo:=fieldbyname('vcroomcode').AsInteger;
end;
close;
end;
stime:='20'+leftstr(strpas(tmpBeginTime),2)+'-'+midstr(strpas(tmpBeginTime),3,2)+'-' +midstr(strpas(tmpBeginTime),5,2)+' '+ midstr(strpas(tmpBeginTime),7,2)+':'+midstr(strpas(tmpBeginTime),9,2);
etime:='20'+leftstr(strpas(tmpEndTime),2)+'-'+midstr(strpas(tmpEndTime),3,2)+'-' +midstr(strpas(tmpEndTime),5,2)+' '+ midstr(strpas(tmpEndTime),7,2)+':'+midstr(strpas(tmpEndTime),9,2);
showmessage(stime+' '+etime);
strpcopy(st,stime);
strpcopy(et,etime);
Readserver92.BuildNo:=-1;
Readserver92.FloorNo:=-1;
Readserver92.Port:=1;
end;
FreeMem(tmpDoorID);
FreeMem(tmpSuitDoor);
FreeMem(tmpPubDoor);
FreeMem(tmpEndTime);
FreeMem(tmpBeginTime);
end
else
begin
strcopy(st,'1900-01-01 00:00');
strcopy(et,'1900-01-01 00:00');
end;
freelibrary(handle92);
end;
uj5u.com熱心網友回復:
高手可否提供下qq 或者加我的qq 1115143749 代碼比較復雜 是兩部分 謝謝啦uj5u.com熱心網友回復:
這段代碼只能走到ret上面的上面 就是說showmessage(inttostr(iport));不能顯示回傳值。轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/97396.html
標籤:語言基礎/算法/系統設計
上一篇:怎么用Indy的TidTCPClient,TidTCPServer來實作聊天軟體的連接客戶管理啊?
下一篇:Delphi 呼叫vb寫的Dll視窗出現:“不能在該主機應用程式中從 ActiveX DLL、ActiveX 控制元件或“屬性頁”顯示非模式表單"
