Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2008 Apr : Binary DFM file To a TMemoryStream as Text

www.cryer.info
Managed Newsgroup Archive

Binary DFM file To a TMemoryStream as Text

Subject:Binary DFM file To a TMemoryStream as Text
Posted by:"Bill Miller" (w2m..@hicomponents00.com)
Date:Thu, 17 Apr 2008 16:13:14 -0400

I searched past ng's and websites for a method to convert a binary dfm file
to text and I found the DFM2TXT method shown below.  This works very well to
read a binary dfm file and write a text dfm file.

Is there another method that can use a TMemoryStream instead of a
TFileStream?
I am looking for a way to load the Text of a Binary DFM file into a TMemo
without creating a file.

function DFM2TXT( Src, Dest: string ): boolean;
var
  SrcS, DestS: TFileStream;
begin
  result := False;
  SrcS := TFileStream.Create( Src, fmOpenRead );
  DestS := TFileStream.Create( Dest, fmCreate );
  try
    ObjectResourceToText( SrcS, DestS );
    result := True;
  finally
    SrcS.Free;
    DestS.Free;
  end;
end;

Regards,

Bill

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive