这里是问题 - 我有一些C图像处理库,我需要从C#应用程序使用。缺乏DllImport的经验现在让我很难受。C#编组字符**和无符号字符**
我需要使用的功能是这样的:
IMAGEPROCESS_API const int importImage
(
const unsigned char* image,
const char* xmlInput,
unsigned char** resultImage,
char** xmlOutput
);
所以,它接受原始图像数据,包含XML参数和图像width'height,然后返回处理后的图像和一些XML报告。
现在我试着接近它是这样的:
[DllImport("imageprocess.dll",CallingConvention = CallingConvention.StdCall,EntryPoint = "importImage",CharSet=CharSet.Ansi)] private static extern int ImportImageNative(IntPtr imageData, String xmlDescriptor, out IntPtr processedImage, out IntPtr xmlOut);
,但没有成功。
任何建议它应该怎么做?
编辑: 仍然没有运气(( 由杂乱C++ CLI完成它现在
你能提供“没有成功”更多的细节? – Dialecticus 2010-10-24 15:06:52
哦,它编译并运行,但遇到访问冲突,所以有些事情是错误的。我已经仔细检查了输入xml,所以我认为问题出在 – ALOR 2010-10-24 15:16:45