在.net 2.0下C#调用Delphi的Dll会出现异常,在.net 1.1下调用正常?
C#程序中调用Delphi写的DLL中的接口,在.net 2.0环境下多次调用同一个接口会出现如下错误
未处理的“System.StackOverflowException”类型的异常出现在 mscorlib.dll 中。
排错提示:
确保您没有无限循环或无限递归。
获取此异常的常常规帮助。
但是接口中并没有循环或无限递归。
但在.net 1.1环境下确没有这个错误。
接口声明如下
[DllImport("ShortMessageAPI.dll",
CharSet = CharSet.Ansi,
CallingConvention = CallingConvention.StdCall)]
public static extern int DoSendMessage(string vBusinessid, string vFromNumber, string vToNumberstring, string vMessage,string vFlag,
ref string Buf, int BufLen);