How to load component from file in Delphi

It's very simple. Just drop TFormSaver component onto your form, set DataFormat property and call the LoadComponentFromFile method.


If YourComponentToLoad is not nil, method modifies passed component and returns it (in this case you can ignore returned value, because method does not modify object pointer), otherwise method creates new component with data from file and returns it.


Please be sure that all the loaded types are registered with standard RegisterClasses procedure or with RegisterTypes method of TFormSaver component that register all the classes used in the owner form.

See also
Form Saver
Components for Delphi / C++ Builder
Howtos for Programmers