C 编写的seccli.dll函数如下:
int SEC_CliSign(char XmlInfo[3800], strlen(XmlInfo), out unsigned char UpSign [180], out nSigLen)strlen(XmlInfo)表示XmlInfo长度
nSigLen 表示UpSign长度.如何申明、调用!!!!
int SEC_CliSign(char XmlInfo[3800], strlen(XmlInfo), out unsigned char UpSign [180], out nSigLen)strlen(XmlInfo)表示XmlInfo长度
nSigLen 表示UpSign长度.如何申明、调用!!!!
[DllImport("User32.dll")]
public static extern int SEC_CliSign(string XmlInfo, int strlen, ref string UpSign , ref int nSigLen);
System.ApplicationException: 未将对象引用设置到对象的实例。 ---> System.NullReferenceException: 未将对象引用设置到对象的实例。
at Sky.BankAgent.Assembly.CCB.LibWrap.SEC_CliSign(String XmlInfo, Int32 strLen, String& UpSign, Int32& nSigLen)具体实现如下:[DllImport("seccli.dll",EntryPoint="SEC_CliSign")]
public static extern int SEC_CliSign(string XmlInfo, int strLen, ref string UpSign, ref int nSigLen);//callint nSigLen = 0;
int retId = 0;
string _xmlInfo = sendData;
string _upInfo = "";int strLen = _xmlInfo.Length;retId = LibWrap.SEC_CliSign(_xmlInfo, nSigLen, ref _upInfo, ref nSigLen);但执行"未将对象引用设置到对象的实例"错误.请高手帮忙.
使用tlbimp yourDLL
能说的具体点吗?
你调试一下看看是那条语句报的错?
public static extern int SEC_CliSign(
[Out, MarshalAs(UnmanagedType.LPArray, SizeConst=180)]
byte[] UpSign );//Call
byte[] bytUpSign = new byte[180];
SEC_CliSign( bytUpSign );有高手这样指导我做,但应用到我提的问题中,不知道怎么处理?请救救我。