I am trying to write Delphi Open Tools API tool for automatic generation and update of the components that are placed on the datamodule or on the form. I can already list all the components (each one is represented by the instance of (the class of) IOTAComponent) and modify their properties (setPropByName(...), getPropValueByName(...)). The question is - how to create new component - in Open Tools API code so that this component is added to the form of datamodule?
I am using IOTAModuleServices part of the API and I guess that is the right part for task at hand, isn't it?
You need to obtain the
IOTAFormEditor
interface for the Form/DataModule that you want to update, and then call itsCreateComponent()
method: