Many friends (including me) on the Forum mentioned that the issue of activeform release was not well resolved.
The following is my experience in developing activeform. I would like to share with you that the development environment is win2000server, iis5.0, bcb5.0, and Delphi.
Let's talk about it first.ProgramDevelopment, if it is transplanted from a general application, note that all forms (except the main form) must be dynamically created, there is no auto-create forms option in the project options. Also, it is very important to implement the IObjectSafety interface. In fact, it is very easy to add two sentences (for BCB, from Borland news group Borland. public. cppbuilder. activeX, Delphi. Sorry, I don't know ):
You have to implement the IObjectSafety interface.
I cut this code from a msdn example and it worked great for me without any
Changes. This Code basically makes everything your control does safe
Scripting and initialization.
You can make the following changes in your class declaration:
Class atl_no_vtable tyourcontrol:
.
.
, Public iobjectsafetyimpl <tyourcontrol> // <--- add this.
Begin_com_map (tyourcontrol)
.
.
Com_interface_entry (IObjectSafety) // <--- add this
.
.
End_com_map ()
Compilation and debugging will not be mentioned. Please check the forum. Let me mention it. It is best to compile all the packages into avtiveform during compilation. The method is the same as that of the general program.
Okay. It's officially started!
Started to set up Oh, myopia quickly put on glasses, the mouse is not easy to catch fast change, keyboard ...... Hi, good. Start now and start ......
Project-> Web deployment options open the settings tab. On the first page, set the path, which is entered based on the actual situation. Be sure not to fill in the error. The following is my filling method (My IIS root directory is c: \ Inetpub \ wwwroot \, and the sub-IP address is 192.168.0.88 ):
Target dir: C: \ Inetpub \ wwwroot \
Target URL: http: // 192.168.0.88/
HTML dir: C: \ Inetpub \ wwwroot \
then there are some Optional options, which are generally all selected. On the second page, set the package. If you compile all the packages into activeform during compilation, you do not need to set it here. It is best to do the same. If you want to set it, refer to settings on the third page. On the third page, additional files are generally some DLL for activeform calling. Many friends cannot install the control, which is largely caused by not setting it here. Sometimes C ++ builder will automatically add the required DLL here, and sometimes it does not exist ...... No way, you still need to use it. If you don't know what special DLL your program uses, you can use some show dependency tools. I used the client dataset in activeform, and it needs to be set to ". dll". Therefore, I added it. It is best to compress it in the same compressed package in the cab option, or set the path below. The path settings are the same as those on the first page.
All right, it's done! Project-> Web deploy, three files are generated under the directory, one INF Installation File, one HTML file, and one compressed file in the cab format (there may also be multiple files, see how you set it ). You can see activefrom by opening the HTML file without any modifications. On other hosts, the security level of IE browser is set to the lowest. Enter the HTML address. Here I am going to http: // 192.168.0.88/printformcontrol.htm. First I am prompted to install XXX. INF file, and then prompts to install XXX. for the cab file, click OK to see activeform. What? Invisible? So I had to look back and see what was wrong .....
That's all. Anyway, I successfully released it like this ...... I don't know if you have released your activeform. Not yet? Really? Have you tried 100 times? What? All over 1,000th times?
Hahaha .....
Actually... In fact, there are more convenient, simpler, and more standard methods!
Ah !!!! Alas... It hurts .... No .. No .. I am not buying bad glasses or broken mouse here, ah! Don't try again !!! I said... I said...
Download a software package for creating a cab. I use powerarchiver to find MicrosoftCodeThe signing software signcode.exe gets a code signature certificate. you can apply for a free certificate at http://www.ca365.com. Well, there are three things. Then modify or re-create a. inf file with the following content:
[Add. Code]
Printcontrol. ocx = printcontrol. ocx
Midas. dll = Midas. dll
[Printcontrol. ocx]
File = thiscab
CLSID = {AECDCD52-732D-43AA-BB90-F8B784E1A169}
Registerserver = Yes
Fileversion =
[Das. dll]
File = thiscab
Fileversion = 6, 0, 6,163
Then, make the *. ocx, *. dll and the. inf file into a cab compressed package. Use signcode.exe and the certificate to sign the code of the compressed package. Modify the HTML file. The content is roughly as follows:
<HTML>
<H1> C ++ Builder 5 ActiveX test page You shoshould see your c ++ Builder 5 forms or controls embedded in the form below.
<HR> <center> <p>
<Object
Classid = "CLSID: AECDCD52-732D-43AA-BB90-F8B784E1A169"
Codebase = "http: // 192.168.0.88/printformcontrol. Cab"
Width = 100%
Height = 100%
Align = center
Hspace = 0
Vspace = 0
>
</Object>
</Html>
Now we can set the security level of IE to medium, and activeform can be downloaded and run as usual. What, don't you use that software? I can't help you anymore. Let's look at the help, huh, huh.