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 Moss
Taz Higgins wrote:
> You need registerclasses
>
> --
> The Taz!
Thank you very much, I found what you we refering to and it worked
great.
Mark Moss