How to load component from stream in Delphi

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

cmpFormSaver.LoadComponentFromStream(YourStreamObject,YourComponentToLoad);

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 stream and returns it.

NewComponent:=cmpFormSaver.LoadComponentFromStream(YourStreamObject,nil);

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