Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Wrapper for ADODB.Stream to System.IO.Stream

4 views
Skip to first unread message

Holger Boskugel

unread,
Dec 15, 2009, 8:14:29 AM12/15/09
to
Hello,

I'm looking for a wrapper implementing an ADODB.Stream interface and
supporting a System.IO.Stream (ADODB2NETStream).

I have taken the interface Stream from ADODB but struggled with the
ADODB.Stream.CopyTo(objMyADODB2NETStream, ...). I get an
InvalidCastException there. Implementing of
System.Runtime.InteropServices.ComTypes.IStream was also out of success.

C#.NET:

class ADODB2NETStream :
ADODB.Stream {

//...

}

VB.NET:

Class ADODB2NETStream
Implements ADODB.Stream

'...

End Class


Using sample:

ADODB.Stream objAStream = new ADODB.Stream();
System.IO.MemoryStream objNStream = new System.IO.MemoryStream();
ADODB2NETStream objA2NStream = new ADODB2NETStream(objNStream);

objAStream.WriteText("Test");

objAStream.CopyTo(objA2NStream, 1);


Who has a solution or good hint to get it working?


Regards from Berlin

Holger


--
http://www.vbwebprofi.de

0 new messages