I try to make an application that starts a script from my program's command-line parameter.
The reason is that I want the end user to run the script from the desktop by double-clicking on the script file without seeing other forms than the ones generated from the script.
All I have done is to create a datamodule with an IDEScripter and then run the following code:
first of all, how are you running a script that is a form? Or do you mean the script uses other script forms? Why not use TIDEEngine and load/run the project itself, instead of a separated script?
Nevertheless, you must register TBitBtn class:
Registerclass(TBitBtn)
TIDEEngine component does it automatically when it's created. Alternatively you can just create a TIDEEngine component.
Now I have added a TTIdeEngine and executed the RunProject method and now the libraries are automatically loaded and the form in the script files shows up. I have also moved the components to the Main form in my app, unless the script close down immediatly. Setting ShowMainForm := false hides the Mainform so now it works as expected.
Script forms are just regular forms, so you have to set an event handler for OnClose event, or create a descendant of TScriptForm and add your own logic to it (then register the new class as the default class for all forms in script)