TomazB
asked on
How to save unknown components
I am saving the whole form trough:
var Stream: TMemoryStream;
Stream:=TMemoryStream.Crea te;
Stream.WriteComponent(MyFo rm);
Stream.Seek( 0, soFromBeginning );
Stream.SaveToFile('MyForm. dfm');
Stream.free;
But if I create a component in run time and instance of such component doesn't exists on this form in design time,
then I can't load back this form from file to app. I get error saying that such component doesn't exist.
How to save form with new components (I would like to load components to form in run time from dll's or so)?
var Stream: TMemoryStream;
Stream:=TMemoryStream.Crea
Stream.WriteComponent(MyFo
Stream.Seek( 0, soFromBeginning );
Stream.SaveToFile('MyForm.
Stream.free;
But if I create a component in run time and instance of such component doesn't exists on this form in design time,
then I can't load back this form from file to app. I get error saying that such component doesn't exist.
How to save form with new components (I would like to load components to form in run time from dll's or so)?
Hi,
// To save the Form you can use this Procedure
WriteComponentResFile('MyF orm.dfm',M yForm);
Cesario
// To save the Form you can use this Procedure
WriteComponentResFile('MyF
Cesario
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or even registerclasses(...
ASKER
Yes, now I don't need to put "dumy" components on form to save and reload it. Is it possible to register component by it's name later - if I want to create instance of new component. like from dll?
how do you insert the new Components at run Time ?
Parent ?
Owner ?
Best Regards
Cesario