创建IStream对象在C# [英] Creating IStream object in C#

查看:122
本文介绍了创建IStream对象在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个项目,并与另一方DLL工作。

I'm writing a project and working with another party DLL.

功能要IStream对象保存的结果,但我不明白如何创建一个IStream对象。

Function from their DLL wants an IStream object to save result, but I can't understand how to create an IStream object.

谁能帮我与我的问题?

推荐答案

您不创建IStream对象,因为很明显,这是一个接口。您应该相当实现此接口,并通过你的对象。或者干脆利用它已经实现了它,如果存在这样的对象的对象。

You don't create IStream object, because obviously it's an interface. You should rather implement this interface and pass your object. Or simply use an object that already implements it, if such object exists.

有关类似的问题已经给了答案给出了一个很好的例子如何使用IStream接口在C#。

Already given answer for a similar question gives a nice example how to use IStream interface in C#.

是否为COM互操作的IStream的包装类已经存在

修正:
本,但是,如果你需要已经在使用你的应用程序内现有的IStream,而不是当你需要创建和传递其他地方的IStream才起作用。对于这项任务,请参阅本作refence如何做到这一点:

Correction: This, however, works only if you need to use already an existing IStream inside your app, not when you need to create and pass an IStream elsewhere. For that task, see this for refence how to do that:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa380034(v=vs.85).aspx

这是来自微软(用于XmlLite的,不知道它是否适合你)

And here is an example from Microsoft (used for XmlLite, not sure if it works for you)

<为例A HREF =http://msdn.microsoft.com/en-us/library/windows/desktop/ms752876(v=vs.85).aspx> http://msdn.microsoft.com/en-us/库/窗/台式机/ ms752876(v = vs.85)的.aspx

或者,也许这个例子中,已经发布由Marcus:
< A HREF =http://hl7connect.blogspot.sk/2010/04/c-implementation-of-istream.html> http://hl7connect.blogspot.sk/2010/04/c-implementation-of-istream html的

Or maybe this example, already posted by Marcus: http://hl7connect.blogspot.sk/2010/04/c-implementation-of-istream.html

这最后一个环节展示了如何使用任何流来实现IStream接口。

This last link shows how to use any Stream to implement the IStream interface.

这篇关于创建IStream对象在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆