DLL函数调用出错:未将对象引用设置到对象的实例
[DllImport("Attend3X.dll",SetLastError = true)]
private static extern int GetRecordEx(
int nPort,int nAddress,long nRecordAddress,ref UInt32 nCardNo,ref DateTime tDateTime,
ref string PBackData,ref int nBackDataLen)
.....
调用时
int nPort = 1;
int nAddress = 1;
long nRecordAddress = 0L;
DateTime tRecordDateTime = new DateTime(DateTime.Now.Year,DateTime.Now.Month,
DateTime.Now.Day);
string sBackData = "";
int nBackDataLen = 0;
int nRet = GetRecordEx(nPort,nAddress,nRecordAddress,ref nCardNo,ref tRecordDateTime,
ref sBackData,ref nBackDataLen)
出错:未将对象引用设置到对象的实例
该动态库其他函数调用正常
动态库为DELPHI所写,
函数声明为
function GetRecordEx(Port,Address:byte;RecordAddress:LongInt;var CardNo:longword;
var DateTime:TDateTime;var PBackData:PChar;var BackDataLen:integer):integer;stdcall;
external 'Attend.dll';