怎么解决这个问题Access Violation at address ×××× in module ****.DLL',Read of address ××××
定义 function IccWrite(pszPortName: pchar; pszPassword: pchar; nPswLen: Integer;pszDataIn:pchar; nLen: Integer;pszCardnoOut: pchar): Boolean;stdcall; external 'SMCICC.dll';
调用IccWrite(pszPortName, pszPassword, nPswLen, pszDataIn, nLen,pszCardnoOut);
值的一体的是每次调用都会出这样的错误
定义 function IccWrite(pszPortName: pchar; pszPassword: pchar; nPswLen: Integer;pszDataIn:pchar; nLen: Integer;pszCardnoOut: pchar): Boolean;stdcall; external 'SMCICC.dll';
调用IccWrite(pszPortName, pszPassword, nPswLen, pszDataIn, nLen,pszCardnoOut);
值的一体的是每次调用都会出这样的错误
这样为pchar分配缓冲区,用stralloc或strnew都可以:
var
apchar:pchar;
apchar:=strnew('a new pchar');//apchar:=stralloc(10);
....
strdispose(apchar);//释放