在C#编写的软件中,调用VC编写的DLL,对图像进行处理,一开始我用小一点的图片运行,调用多少次DLL,都没有问题,但是后来我用了一副比较大的图片运行,第一次调用都没有问题,可是一旦第二次调用,就会报出“VC Runtime Library”的错误:具体阐述如下:“Runtime Error
Program: 工程路径\bin\Debug\工程名.vshost.exe
This application has requested the runtime to terminate it in an unusual way, Please contact the application's support team for more information”
请问为什么会出现这样的情况,怎么解决?
Program: 工程路径\bin\Debug\工程名.vshost.exe
This application has requested the runtime to terminate it in an unusual way, Please contact the application's support team for more information”
请问为什么会出现这样的情况,怎么解决?
内存分配和释放的契约要规定好, 只可在一方申请, 释放.对数据结构的解读要一致, 比如 struct 类型的内存布局, 要在 .net 声明好.
调用参数中也没有涉及到struct等类型,只是一些普通类型。
C# 里的 string 与 VC 的CString 都是有较大区别的参数类型。