动态调用明华Mwic_32.dll的问题
(4)int wsc_4442(int icdev,int len,unsigned char *databuff)
说明: 改写卡密码
调用: icdev: 通讯设备标识符
len: 字符串长度,其值为3
databuff: 存放要改写的密码数据
返回: <0 错误
=0 正确
举例: unsigned char databuff[3]={0xB6,0x23,0x07};
st=wsc_4442(icdev,3,databuff);
我的调用是
extern "C" int __stdcall clearPwd(int icdev)
{
int value;
unsigned char pwd[3]={0xff,0xff,0xff};
typedef int(__stdcall *Wsc)(int icdev,__int16 len,unsigned char *databuff);
HINSTANCE hDll=NULL;
hDll=LoadLibrary("llMwic_32.dll");
if(hDll)
{
Wsc w;
w=(Wsc)GetProcAddress(hDll,"wsc_4442");
value=w(icdev,3,pwd);
FreeLibrary(hDll);
}
return value;
}
为什么返回不是0?