MENU

Fun & Interesting

Delphi: How to saving and restore properties from componentes in file, like IDE do in FRM file

Emailx45 64 1 month ago
Video Not Working? Fix It Now

Writes components and their properties to a file using a resource file format. Use WriteComponentResFile to save the component specified by the Instance parameter to the specified file, storing it in a resource-file format. To read a component written with WriteComponentResFile, call ReadComponentResFile. Reads components and their properties from a specified Windows resource file. Call ReadComponentResFile to create a component and its children from their representation in a Windowsresource file. The FileName parameter is the name of the compiled resource file that contains the component resource. The Instance parameter is an instance of the type of component that should be read. Create an instance of the appropriate type of object, and then call ReadComponentResFile to read in its property settings. If Instance is nil (Delphi) or NULL (C++), the object class is read from the resource. Before passing an Instance parameter of nil (Delphi) or NULL (C++), all classes being read must have been registered using the RegisterClass or RegisterClasses routine. ReadComponentResFile returns an instance of the component that was read from the resource file.

Comment