Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory pointer from ADOdb.Stream
Message
From
20/03/2007 09:54:46
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01205533
Message ID:
01206045
Views:
24
Hi Sergey,

That was my fear...

:-((

Thanks anyway, I'll continue going to the conventional way.

Regards

Cesar

>I don't think that ADODB.Stream exposes stream handle.
>
>>I need to Save an Image to a Stream using GDI+
>>
>>Rick Strahl suggested me to try using ADODB.Stream
>>To make it work, I need to obtain the Handle, the memory pointer that ADO reserved for my Stream
>>This handle will be passed to GDI+ further
>>I've searched all over the web, but did not find any tip on that... Maybe I didn't look at the right places...
>>
>>
>>I want to try the ADOdb.Stream class because using the normal Stream access, with direct API calls to CreateStreamOnHGlobal and directly managing the memory or using Calvin's wrapper class for IStream, that he provided at this very cool post Calvin Hsia's WebLog : Use an IStream object to avoid disk access http://blogs.msdn.com/calvin_hsia/archive/2006/02/17/534529.aspx , I'm having some bad performance results.
>>
>>I expected that using streams, we could have a better performance than saving an image to the disk, but that's not what is happening using these 2 aproaches.
>>
>>That's why I want to try with ADOdb.Stream, to check if ADOdb managed streams in a different way.
>>
>>Any tips ?
>>
>>Below is the code that I want to use for that
>>
>>
>>
LOCAL loADOSTream as "ADODB.Stream"
>>loADOStream = CREATEOBJECT("ADODB.Stream")
>>
>>*!* Set Stream Object properties.
>>loADOStream.TYPE = 1	&& 1=Binary Data, 2=Text Data.
>>loADOStream.OPEN
>>
>>
>>
>>Here I need to get the Handle, the memory pointer that ADO reserver for my Stream
>>This handle will be passed to GDI+ further
>>
>>
>>
m.lhStream = ?????????????????????
>>
>>*!* Save the picture to the stream
>>loBmp.Save(m.lhStream, .Imaging.ImageFormat.Bmp) && Pass the stream handle to Save method
>>
>>lcPicture = ""
>>lcPicture = loADOStream.Read()
>>
>>*!* Close connections.
>>loADOStream.CLOSE
>>
>>
>>Thanks in advance
>>
>>cesar Chalom
Previous
Reply
Map
View

Click here to load this message in the networking platform