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

TStream.ReadComponentRes/WriteComponentRes - Help, I'm on a Deadline

140 views
Skip to first unread message

Mark E. Moss

unread,
Apr 5, 1999, 3:00:00 AM4/5/99
to
Help

I am getting the following message when I try to restore a saved
resource file

Project Project1.exe Raised Exception Class ECLASS Not Found with
Message
'Class TScrollBox Not Found' Process Stopped. Use Step or Run to
Continue.

If you need the Resource file that I am attempting to use, I will be
happy to E-Mail it to you
as the powers that run this web site deleted my last posting which had
it attached.


Mark Moss
(719) 687-0230
mark...@s4.com

{==============================================================================}

The code below is is how I save all of the components that are on a form
off to a resource file

{==============================================================================}

procedure TfrmWizard.SaveToFile(AResFile: TFileName);
var
Stream: TFileStream;
FormName: string;
begin
FormName := Copy(ClassName, 2, 99);
Stream := TFileStream.Create(AResFile, fmCreate);
try
Stream.WriteComponentRes(FormName, Self);
finally
Stream.Free;
end;
end;

{==============================================================================}

The code below is is how I Restore all of the components from the
resource file

{==============================================================================}

procedure TfrmWizard.RestoreFromFile(AResFile: TFileName);
var
Stream: TFileStream;
I: integer;
begin
try
Stream := TFileStream.Create(AResFile, fmOpenRead);
try
{delete all components}
for I := ComponentCount - 1 downto 0 do
Components[I].Free;
Stream.ReadComponentRes(Self);
finally
Stream.Free;
end;
except
on EFOpenError do {nothing};
end;
end;

{==============================================================================}


Mark E. Moss

unread,
Apr 5, 1999, 3:00:00 AM4/5/99
to t...@taz.cix.co.uk
Would you please explain what you mean by that?

Mark Moss

Taz Higgins wrote:

> You need registerclasses
>
> --
> The Taz!


Taz Higgins

unread,
Apr 6, 1999, 3:00:00 AM4/6/99
to

Mark E. Moss

unread,
Apr 6, 1999, 3:00:00 AM4/6/99
to t...@taz.cix.co.uk
Taz

Thank you very much, I found what you we refering to and it worked
great.

Mark Moss

0 new messages