VC++2008 MFC错误
void CICCarReadDlg::OnBnClickedButton1()
{
#define BLOCK0_EN 0x01
#define BLOCK1_EN 0x02
#define BLOCK2_EN 0x04
#define NEEDSERIAL 0x08
#define EXTERNKEY 0x10
unsigned char status;
unsigned char myareano;
unsigned char authmode;
unsigned char myctrlword;
unsigned char mypicckey[6];
unsigned char mypiccserial[20];
unsigned char mypiccdata[500];
typedef unsigned char (__stdcall *piccreadex)(unsigned char ctrlword,unsigned char *serial,unsigned char area,unsigned char keyA1B0,unsigned char *picckey,unsigned char *piccdata0_2);
typedef char (__stdcall *pcdbeep)(unsigned long xms);
HINSTANCE hDLL;
piccreadex picx ;
pcdbeep laba;
hDLL=LoadLibrary(LPCWSTR("OUR_MIFARE.dll"));
picx=(piccreadex)GetProcAddress(hDLL,"piccreadex");
laba=(pcdbeep)GetProcAddress(hDLL,"pcdbeep");
myctrlword = BLOCK0_EN +BLOCK1_EN+BLOCK2_EN+ EXTERNKEY;
myareano = 0;
authmode = 1;
mypicckey[0] = 0xff;
mypicckey[1] = 0xff;
mypicckey[2] = 0xff;
mypicckey[3] = 0xff;
mypicckey[4] = 0xff;
mypicckey[5] = 0xff;
status = picx(myctrlword,mypiccserial,myareano,authmode,mypicckey,mypiccdata); 这块有问题!
//::SendMessage(NULL,status,39,40);
laba(10);
FreeLibrary(hDLL);
}
错误消息:
ICCarRead.exe 中的 0x00000000 处最可能的异常: 0xC0000005: 读取位置 0x00000000 时发生访问冲突
ICCarRead.exe 中的 0x00000000 处未处理的异常: 0xC0000005: 读取位置 0x00000000 时发生访问冲突
authmode 1 '' unsigned char
myareano 0 unsigned char
myctrlword 23 '' unsigned char
+ mypiccdata 0x0012f300 "啊啊啊啊啊" unsigned char [500]
+ mypicckey 0x0012f518 "啊啊啊啊" unsigned char [6]
mypicckey[5] 255 '' unsigned char
+ mypiccserial 0x0012f4fc "啊啊啊啊啊" unsigned char [20]
picx 0x00000000 unsigned char (unsigned char, unsigned char *, unsigned char, unsigned char, unsigned char *, unsigned char *)*
status 204 unsigned char
+ this 0x0012fe28 {CICCarReadDlg hWnd=0x000207d6} CICCarReadDlg * const