请问哪位读取IC卡数据的程序呢(50分)

K

kbkiss

Unregistered / Unconfirmed
GUEST, unregistred user!
我现在要写一个IC卡的读写程序,有厂家的DLL,现在要用VC++写我写的老是出错,
不知那们大哥有过IC卡的经验,可否帮帮我,非常感谢!我这边用的是飞利普的mf1 ic s50卡
我的QQ是30552764在线等
 
问厂家要DEMO。
 
呵呵,我不会vc++,但是会一点delphi.就我知道的,好象这种IC卡的读写程序比较多得人用的是delphi哦.
 
找本书好好看看吧,难度不大的,我学了一个上午学会的
 
读写器的DLL,都有例子,
 
我在有厂家的DLL里面有个读卡块的函数,我现在要用VC写,哪位大哥帮帮我,我可以把DLL发给他.
 
一般Dll都是C或C++定的,你把DLL说明放出来,还有你的调用代码.
让大家看看错在哪.
 
我在一个按钮的单击事件中是这样写的:
unsigned short i=1;
char pBuf[100];
memset(pBuf,0,sizeof(pBuf));
CString str;
char pqh[3]="01";
char pkh[3]="05";
HINSTANCE hInst;
hInst = LoadLibrary("icDllwd.dll");
if(hInst==NULL) AfxMessageBox("can't open dll file");

typedef bool (*ReadBlank)(int port, char * s1, char * s2, char * s3);//bool strchar(char *h)
ReadBlank add = (ReadBlank)GetProcAddress(hInst,"_ReadBlank@16");
if (!add)
{
MessageBox("失败!");
return;
}
else
{
if(add(i,pqh,pkh,pBuf))
{
str=pBuf;
MessageBox(str);
}
else
{
MessageBox("没成功!");
}
}
ReadBlank这个函数在DLL是这这样的:
extern "C" __declspec(dllexport) BOOL __stdcall ReadBlank(int port,char * s1,char * s2,char * s3)
我运行时出现
Debug Error!
File :i386/chkesp.c
line:42
The valuse of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention .

谢谢!
 
你在调用时最好也使用stdcall
 
我用Delphi写过一个Demo程序,是用的Mifire1卡,菲利普芯片
 
我要一个delphi的
谁有啊?
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部