我正在使用 VS 2008 C# Windows 应用程序。
我有这个我正在尝试使用的 DLL 导入。
[DllImport("Mapi32.dll", PreserveSig = true)]
private static extern void
WrapCompressedRTFStream(
[MarshalAs(UnmanagedType.Interface)]
UCOMIStream lpCompressedRTFStream,
uint ulflags,
[MarshalAs(UnmanagedType.Interface)]
out UCOMIStream lpUncompressedRTFStream
);
public const uint MAPI_MODIFY = 0x00000001;
public const uint STORE_UNCOMPRESSED_RTF = 0x00008000;
我有一个 CompressedRFTFormat 格式的压缩字符串。
如何将字符串传递到 WrapCompressedRTFStream?我不明白该方法的期望是什么。
我正在尝试在按钮上使用它。
RichText1.text = WrapCompressedRTFStream(_CompressedRichText.ToString(),something,somethingelse);
我得到的第一个错误是“无法从'字符串'转换为'System.Runtime.InteropServices.UCOMIStream”
我希望了解这篇文章的人能提供有帮助的答案!
好的,所以当我使用 IStream 时,我最终会遇到同样的情况。
[DllImport("Msmapi32.dll", PreserveSig = true)]
private static extern void WrapCompressedRTFStream(
[MarshalAs(UnmanagedType.Interface)]
IStream lpCompressedRTFStream,
uint ulflags,
[MarshalAs(UnmanagedType.Interface)]
out IStream lpUncompressedRTFStream
);
这里真正的问题是我不明白什么/如何处理这个方法的输入和输出。