There are two methods of deploying ActiveX components: you can either deploy them using Regsvr32 or you can deploy them in a more automated fashion using Visual InterDev 6.0. The remote deployment capabilities for middle-tier COM server components is one of the exciting new features in Visual InterDev 6.0. In this section, we'll see how both of these procedures are performed.
Regsvr32 is a program that allows you to register components from the command line. You can launch Regsvr32 either from within the Run dialog by choosing Start|Run or from within the DOS Command Prompt by choosing Start|Programs|MS-DOS Prompt. Regsvr32 has the following syntax:
Regsvr32 [/u] [/s] [/n] [/i[:cmdline]] dllname Where dllname - Component to register cmdline - Optional command line parameters /u - Unregister server /s - Silent; display no message boxes /c - Console output /i - Call dllinstall passing it an optional [cmdline]; when used with /u calls dlluninstall /n - Do not call dllregisterserver; this option must be used with /i
The most common usage of Regsvr32 is simply to call it and pass it the name of the component that you want to register, as shown in the following example.
C:\regsvr32 vibank.dll
Of course, Regsvr32 has to be run locally on the machine on which you want to register the component. You also have to manually copy the component DLL file to the machine prior to registration. Figure 18-9 shows the output message box after the component has been successfully registered.
Figure 18-9. The message box displayed after a component has been successfully registered using Regsvr32.
Using Visual InterDev 6.0 to remotely deploy the component can be much more convenient as we'll see in the next section.
Now that we've seen how to deploy a component using Regsvr32, let's take a look at the equivalent operation within Visual InterDev 6.0. For developers, this is a much more straightforward approach—you develop your component on a workstation along with your Web project and then deploy the component to the server remotely.
NOTE
To register components through Visual InterDev on a remote Web server, the Web server must have IIS installed with the Visual InterDev RAD Remote Deployment Support option selected during custom installation.
The first step is to add your component to a Web project:
Your component will now be added to your Web project.
Figure 18-10 shows the Project Explorer with an ActiveX DLL named vibank.dll added to the Components folder within the VI-Bank Web project.
Figure 18-10. The Project Explorer within Visual InterDev 6.0 showing a component that has been registered remotely.
Now that the component has been added to your Web project, you are ready to register it on the server. You can do this as follows:
Figure 18-11. The Component Installation tab of the component Properties dialog box.
After you select OK, the component will be registered on the server. You'll be able to see the sequence of events by watching the status bar in the lower left corner of the screen.
NOTE
If your master Web server and local project are on the same computer, the registry for that machine notes the component only once, not once each for the master and local version. If you remove the local copy, the registry entry for the component is also removed, even though the component is marked as a server component in the project.
If you want to deploy your entire Web project, including components, to another destination Web server (that is, not your local or master Web server), you can use Visual InterDev to register the components. You can do this as follows:
Figure 18-12 shows the Copy Project dialog box with the Register Server Components check box marked. In this example, the VI-Bank Web project is being copied to a Web server named testserver.
Figure 18-12. The Copy Project dialog box showing the Register Server Components check box. This dialog box is used to copy a Web project, including components, from one server to another.