這裏是問題 - 我有一些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