L
lingxin
Unregistered / Unconfirmed
GUEST, unregistred user!
int __stdcall (*mf_ReadRfid)(unsigned char *id, unsigned char *type);
void __fastcall TForm1::Button8Click(TObject *Sender)
{
(FARPROC&) mf_ReadRfid = GetProcAddress(hDll,"mf_ReadRfid"
if (mf_ReadRfid != NULL)
{
unsigned char snr[8];
int retVal;
unsigned char type = 0;
AnsiString msg="";
mf_Led(1);
mf_Beep(1);
retVal = mf_ReadRfid(snr, &type);
if (retVal == ERR_NOERROR)
{
DWORD id=0;
AnsiString sid="";
msg = "";
id = (DWORD)(snr[0]<<24) |
(DWORD)(snr[1]<<16) |
(DWORD)(snr[2]<<8) |
snr[3];
msg.printf("卡号:%010lu 厂商代码:%02X",id,type);
sid.printf("%010lu",id);
Edit6->Text = sid;
Edit7->Text = IntToHex(type,02);
}
else
{
msg = GetErrMsg(retVal);
}
Memo1->Lines->Append(msg);
mf_Led(0);
mf_Beep(0);
}
else
{
Application->MessageBox("DLL函数定位错误(mf_ReadSnr)!","Error",MB_OK);
}
}
void __fastcall TForm1::Button8Click(TObject *Sender)
{
(FARPROC&) mf_ReadRfid = GetProcAddress(hDll,"mf_ReadRfid"
if (mf_ReadRfid != NULL)
{
unsigned char snr[8];
int retVal;
unsigned char type = 0;
AnsiString msg="";
mf_Led(1);
mf_Beep(1);
retVal = mf_ReadRfid(snr, &type);
if (retVal == ERR_NOERROR)
{
DWORD id=0;
AnsiString sid="";
msg = "";
id = (DWORD)(snr[0]<<24) |
(DWORD)(snr[1]<<16) |
(DWORD)(snr[2]<<8) |
snr[3];
msg.printf("卡号:%010lu 厂商代码:%02X",id,type);
sid.printf("%010lu",id);
Edit6->Text = sid;
Edit7->Text = IntToHex(type,02);
}
else
{
msg = GetErrMsg(retVal);
}
Memo1->Lines->Append(msg);
mf_Led(0);
mf_Beep(0);
}
else
{
Application->MessageBox("DLL函数定位错误(mf_ReadSnr)!","Error",MB_OK);
}
}