Card reader function description in the following, to open the port function call everything is normal, but the call function of the credit card information has been an error, how do I write is correct, what a great god can give directions, best can detail, thank you,
//social security card and open information Typedef struct TPublicInfoTag { Char cCardNo [9]./* card number */ Char cName [30]./* name */ Char cSex [1]./* */gender Char cPersonalID [18]. Id/* */ Char cPhone [15]./* phone number */ Char cAddress [80]./* address */ Char cPostCode [6]./*/postal code * } TPublicInfo;
Function description Yibao. Within the DLL function description
//open the serial port, Such as handle=ICC_Reader_Open (" COM1 ");
STDAPI ICC_Reader_Open (BYTE * pCOM);
//close the serial port yibao. DLL STDAPI ICC_Reader_Close (int ReaderHandle);
Iccdll. Within the DLL function description
//read social security card and open information STDAPI ReadPublicInfo (int ReaderHandle, TPublicInfo * pInfo);//iccdll. DLL
Above function returns for the int type right is less than 0 error greater than 0
CodePudding user response:
My writing is the fact that the Function declaration: the Function int ReadPublicInfo (int ReaderHandle, ref string pInfo) library "iccdll. DLL " String cCardNo, cName, cSex cPersonalID, cPhone, cAddress, cPostCode Li_i=ICC_Reader_open (" COM4 ") CCardNo=space (9) ReadPublicInfo (256, cCardNo)
But the corresponding function type wrong
CodePudding user response:
In front of the other li_i=ICC_Reader_open (" COM4 ") is wrong, don't have to see,
CodePudding user response:
//this statement a try, if not use the blob pb10 later to add other alias ANSI The Function int ReadPublicInfo (int ReaderHandle, ref char pInfo [159]) library "iccdll. DLL " String cCardNo, cName, cSex cPersonalID, cPhone, cAddress, cPostCode Li_i=ICC_Reader_open (" COM4 ") Char cCardNo [159] ReadPublicInfo (li_i cCardNo)