|
比如我在dll中有这样一段
extern "C" __declspec(dllexport) IplImage* photo(int x, int y)
{
IplImage *videoImgLearn = cvLoadImage("imgs/1.jpg"); ;
return videoImgLearn;
}
在C#中调用
[DllImport("CSharpInvokeCPP.CPPDemo.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr photo(int a, int b);
然后在main中调用
IntPtr image = CPPDLL.photo(1, 1);
运行时image总是0
我即使在C#中用Emgu.CV,但是这个的类型也是IntPtr ,也不行希望高手帮帮忙啊,或者给个参考资料。。纠结好久了 |
|