Steps: Overview:
1. -Create your ActiveX control
2. -Deploy it for the Web
3. -Register your ActiveX control using the executable 'regsvr32.exe'
4. -Run the created HTML file in your browser
Steps: Worked out:
1. -Create your ActiveX control
1. Start Delphi
2. Create an 'Active Form'
1. -Select from menu option 'File'
2. -Select from list 'New'
3. -Select from list 'Other...'
4. -Select tab 'ActiveX'
5. -Click on icon 'Active Form'
3. Put something on this form
e.g.
1. Put a panel with a button and a TEdit on the form
(panel align:= alTop)
2. Put a TEmbeddedWB (Align alCilent)
3. Double click on this button
4. EmbeddedWB1.Go(Edit1.Text);
4. Possibly save your project in a directory of your liking
(menu 'File'->'Save all', browse to your directory
e.g. c:\temp and press the 'Save' button twice)
1. This will create a couple
of files in that directory,
the most important is the
file with the extension .ocx
which contains your just created
ActiveX control
e.g.
ActiveFormProj1.ocx
2. -Deploy it for the Web
1. -Select from menu option 'Project'
2. -Select from list 'Web Deploy'
1. -In the text box 'Target dir' type or browse to the directory where your .ocx file is located
e.g.
c:\temp
2. -In the text box 'Target URL' type or browse to the directory where your .ocx file will be deployed (do not choose this to be the same as your current .ocx directory, or you will get the
error '.ocx in use by another process', when
you try to save your result)
e.g.
c:\anotherdirectory
3. -In the text box 'HTML Dir'
type or browse to the directory where your .htm file
(which will automatically be generated by Delphi)
should be located
e.g.
c:\anotherdirectory
3. -Click button 'OK'
3. If you want to run it from Delphi, you could
1. -Select from menu option 'Run'
2. -Select from list 'Parameters'
3. -Select as 'Host application' your Microsoft Internet Explorer
browser
e.g.
C:\Program Files\Internet Explorer\iexplore.exe
4. -Select as 'Parameter' the name of the generated .htm file directory
e.g.
c:\anotherdirectory\ActiveFormProj1.htm
5. -Click button 'OK'
6. -Register your ActiveX control using the executable 'regsvr32.exe' on the MSDOS command line type the command
regsvr32.exe <your .ocx filename>
e.g.
regsvr32.exe c:\temp\ActiveFormProj1.ocx
That should show 'DllRegisterServer in <your .ocx filename>
succeeded.
e.g.
'DllRegisterServer in ActiveFormProj1.ocx succeeded'
Note:
This will have created some entries in the Windows registry,
so that your .ocx ActiveX can be trusted on this computer.
---
Note:
If you do not register your .ocx file, you will get a message
that the ActiveX can not be safely run in your browser (Your
current security settings prohibit running ActiveX controls on
this page. As a result, the page may not display correctly),
and you will not see the form shown (or just as an image with
a 'x' in it) in your browser.
---
Note:
For testing purposes of your own Delphi ActiveX programs, you
might have to set security settings in your Microsoft Internet
Explorer browser (menu 'Tools'->'Internet Options...'->tab
'Security'->button 'Custom level'->select radiobutton 'Prompt'
in 'Initialize and Script ActiveX controls not marked as
safe').
7. -Run your application (e.g. click on the green '>' or press the <F9> key).
8. -That will start your browser with that form in it
9. -Repeat the above steps until your are satisfied with the result
4. -Run the created HTML file in your browser
1. In the directory where you during the 'Web deploy'
Chose to store your .htm file
(e.g. in c:\anotherdirectory) there was also created a
.htm file, similar to the following:
Tested successfully on Microsoft Windows XP Professional running Delphi 7.