草
草在墙头
Unregistered / Unconfirmed
GUEST, unregistred user!
如何将下列程序转成delphi:
struct _STATUS
{
unsigned char me1; /* 1st card status word */
unsigned char me2; /* 2nd card status word */
unsigned int MED; /* reader status */
}tstatus ;
extern "C" int cpuIccPowerUp(unsigned int Icslot,
unsigned char *respone,
unsigned char *lRep,
_STATUS *,
int ComPort,
int timeout);
void CStmddllchkDlg::OnButton28()
{
unsigned char *Cretdata = new unsigned char[500];
int i;
unsigned char Cretlen;
int nRetCode;
CString Ret="";
CString me1="";
CString me2="";
CString retdata="";
if ((nRetCode=cpuIccPowerUp(m_command1.GetCurSel(),
Cretdata,
&Cretlen,
&tstatus,
ComPort,5))!=0)
{
Ret.Format("%x",nRetCode);
Ret=" 卡片上电失败! 状态返回= "+Ret;
MessageBox(Ret);
}
else
{
for(i=0;i<Cretlen;i++)
retdata.Format("%x",Cretdata);
me1.Format("%x",tstatus.me1);
me2.Format("%x",tstatus.me2);
retdata=" 上电成功,返回="+retdata + " SW1="+me1+" SW2="+me2;
MessageBox(retdata);
}
delete Cretdata;
}
struct _STATUS
{
unsigned char me1; /* 1st card status word */
unsigned char me2; /* 2nd card status word */
unsigned int MED; /* reader status */
}tstatus ;
extern "C" int cpuIccPowerUp(unsigned int Icslot,
unsigned char *respone,
unsigned char *lRep,
_STATUS *,
int ComPort,
int timeout);
void CStmddllchkDlg::OnButton28()
{
unsigned char *Cretdata = new unsigned char[500];
int i;
unsigned char Cretlen;
int nRetCode;
CString Ret="";
CString me1="";
CString me2="";
CString retdata="";
if ((nRetCode=cpuIccPowerUp(m_command1.GetCurSel(),
Cretdata,
&Cretlen,
&tstatus,
ComPort,5))!=0)
{
Ret.Format("%x",nRetCode);
Ret=" 卡片上电失败! 状态返回= "+Ret;
MessageBox(Ret);
}
else
{
for(i=0;i<Cretlen;i++)
retdata.Format("%x",Cretdata);
me1.Format("%x",tstatus.me1);
me2.Format("%x",tstatus.me2);
retdata=" 上电成功,返回="+retdata + " SW1="+me1+" SW2="+me2;
MessageBox(retdata);
}
delete Cretdata;
}