Many people want to make the application they write into a browser interface and use the application by opening the browser. In fact, it is very simple to implement in delphi. Let’s use delphi6.0 as an example to make the complete steps of the implementation. Write it as follows:
1. Select "file/new/other" and select the activex option in the new items dialog box, and select Create activex form. At this time, a dialog box will pop up to enter the name of the activex component you have created, the object pascal program unit name, the project name, etc. There are also some activexes that include version control numbers and other options, you can click OK directly according to the default settings.
2. Now you can design your program in the open project. Here, like the design of general applications, you can create different forms according to your needs to realize your own functions. But one thing to note is that the calls between forms cannot be implemented using form.showmodal. It requires dynamic call to ShowForm, as shown in the following definition process:
|
When calling form2, you can use: showform(Tform2). After the programming is completed, save the unit file and project file to the corresponding directory. Assume saved in "c:/my documents".
3. After the programming is completed, you can prepare to generate the application you want, but instead of clicking to run, you first select "project/web deployment options" and add it to "Target dir" in the project option. /", "Add "./" in "Target URL", "Add "./" in "HTML dir" to set some file storage paths. Finally, select "project/web deploy" and click "yes to all".
At this time, when you open "c:/my documents", you will see the generated htm file. When you open the htm file, you will see that the application you designed can be used in the browser. You can use the web editor to modify the generated htm file to make it more in line with your requirements. The complete implementation process is over. In fact, Delphi compiles the written application into an activex component and calls the activex component in the browser, so it is only suitable for some small applications.
Many people want to make the application they write into a browser interface and use the application by opening the browser. In fact, it is very simple to implement in delphi. Let’s use delphi6.0 as an example to make the complete steps of the implementation. Write it as follows:
1. Select "file/new/other" and select the activex option in the new items dialog box, and select Create activex form. At this time, a dialog box will pop up to enter the name of the activex component you have created, the object pascal program unit name, the project name, etc. There are also some activexes that include version control numbers and other options, you can click OK directly according to the default settings.
2. Now you can design your program in the open project. Here, like the design of general applications, you can create different forms according to your needs to implement your own functions. But one thing to note is that the calls between forms cannot be implemented using form.showmodal. It requires dynamic call to ShowForm, as shown in the following definition process:
|
When calling form2, you can use: showform(Tform2). After the programming is completed, save the unit file and project file to the corresponding directory. Assume saved in "c:/my documents".
3. After the programming is completed, you can prepare to generate the application you want, but instead of clicking to run, you first select "project/web deployment options" and add it to "Target dir" in the project option. /", "Add "./" in "Target URL", "Add "./" in "HTML dir" to set some file storage paths. Finally, select "project/web deploy" and click "yes to all".
At this time, when you open "c:/my documents", you will see the generated htm file. When you open the htm file, you will see that the application you designed can be used in the browser. You can use the web editor to modify the generated htm file to make it more in line with your requirements. The complete implementation process is over. In fact, Delphi compiles the written application into an activex component and calls the activex component in the browser, so it is only suitable for some small applications.