【发布时间】:2011-04-29 20:23:40
【问题描述】:
这就是问题所在 - 我有一些 C 图像处理库需要从 C# 应用程序中使用。缺乏使用 DllImport 的经验让我现在很难受。
我需要使用的函数如下:
IMAGEPROCESS_API const int importImage
(
const unsigned char* image,
const char* xmlInput,
unsigned char** resultImage,
char** xmlOutput
);
因此,它接受原始图像数据,包含参数的xml和图像宽度'高度,然后返回处理后的图像和一些xml报告。
现在我试图这样处理它:
[DllImport("imageprocess.dll",CallingConvention = CallingConvention.StdCall,EntryPoint = "importImage",CharSet=CharSet.Ansi)] private static extern int ImportImageNative(IntPtr imageData, String xmlDescriptor, out IntPtr modifiedImage, out IntPtr xmlOut);但没有任何成功。
有什么建议应该怎么做?
编辑: 仍然没有运气(( 现在是由凌乱的 C++ CLI 完成的
【问题讨论】:
-
您能否提供有关“没有任何成功”的更多详细信息?
-
哦,编译运行了,但是遇到了访问冲突,确实是有问题。我已经仔细检查了输入 xml,所以我认为问题出在输出
标签: c# marshalling dllimport