Solved

How to create a copy of TOLEStream Object

Posted on 2002-05-20
8
281 Views
Last Modified: 2010-04-04
Hi Experts

I got a problem where i have to create a copy of TOleStream Object. And I am not able to do the same

my code snippet is some thing like this

var
stream:TOleStream

procedure aProcedure(var oleStream:TOleStream);
begin

     // here i am trying to do like this
     stream:=olestream; //compiling but run time errors


    {
           And Other Code
    }
end;



Please tell me how to copy olestream object to anoter olestream object so that my problem can be soved

And this procedure i am writing in DLL


Thanks
Koundinya
0
Comment
Question by:sudhakar_koundinya
8 Comments
 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 7021658
It is Giving the error for Unknown Memory Access
0
 
LVL 8

Expert Comment

by:Cesario
ID: 7021765
simply

VAR
  stream : tMemoryStream;

....
....

 stream.LoadFromFile(olestream);


good luck

Cesario
0
 
LVL 4

Expert Comment

by:nestorua
ID: 7022219
HI,
You mean Stream.LoadFromStream(OleStream).
But it works when you read into MemoryStream.
To read from OleStream to OleStream use CopyFrom method of
TStream object.
Sincerely,
Nestorua.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 7023267
Hi guys,

Thanks for the response.But it is not working and giving the same problem. I tried with other stream objects and working fine. But with TOleStream Object i am facing problems.

I tried to change my logic by using pointers instead of using coping of the same object. But no use. Same problem persists. I am not understanding where i am facing the problem.  Please help me

type
PTOleStream=^ToleStream;

var
streamPtr:PTOleStream;
constructor Create(ptrOLE:PTOleStream)
begin
   streamPtr:ptOLE;
end;

Thanks
Koundinya
0
 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 7115726
Hi Guys,

I want to close this session. As No body gave me the right answer, I want to delete this session.
Please Comment on this.

Thanks
Koundinya
0
 

Expert Comment

by:lingababu
ID: 7133597
 

0
 

Expert Comment

by:lingababu
ID: 7133598
           

0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 7976851
PAQ'd and points refunded

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question