Visual Basic Concepts
Distributing Controls
As discussed in "Two Ways to Package ActiveX Controls," earlier in this chapter, Visual Basic lets you author shareable control components (.ocx files), or simply include private controls as .ctl files in the project for your application or component.
This topic and its related topics focus on distribution, versioning, and licensing issues for control components. Private controls are compiled directly into an executable or component, and are distributed along with it. Being private, they also have no versioning or licensing issues.
Distributing Control Components
When you distribute a control component, you're providing a tool other developers can use in their applications. Versioning issues address the question of how you update that tool without breaking your customers' code.
Because you're providing a tool, instead of a finished application, you have licensing issues to consider. You have to decide whether to include licensing support for your control. If you plan on building your controls using licensed controls from other authors, you need to consider how that affects your distribution plans.
Because the tool you're creating is an-process component ("ocx" is really just another way to spell DLL), you have to select a base address that will minimize memory conflicts, and thus avoid performance problems.
Finally, because the tool you're creating uses the Visual Basic run-time DLL, and possibly other support files, you have to create a Setup program.
Setup is covered in the remainder of this topic. The important subject of base addresses is discussed in "Setting Base Addresses for In-Process Components" in "Debugging, Testing, and Deploying Components."
Licensing and versioning issues are covered in the following related topics:
Licensing Issues for Controls Explains how to add licensing to your control project, and discusses the implications of using licensed controls as constituent controls.
Versioning Issues for Controls Explains the four areas of compatibility you need to consider when you create a new version of your control.
Important Be sure to set the description for each control in your control component. Some clients, such as Visual Basic, represent the entire .ocx file using the string you enter in the Project Description box of the Project Properties dialog box, but others display the browser strings for the individual controls. See "Providing Help and Browser Strings for Objects," in "Debugging, Testing, and Deploying Components."
Creating Setup for ActiveX Control Components
ActiveX controls created with Visual Basic require the Visual Basic run-time DLL. Depending on what constituent controls you use, you may require additional support files. To ensure that you distribute all the necessary support files, using SetupWizard is recommended.
For the most part, using SetupWizard for control components is no different from using it for any other component created using Visual Basic. This subject is thoroughly covered in "Debugging, Testing, and Deploying Components."
If you plan to use your control component for Internet or intranet development, you can obtain the most up-to-date information on setup options from the Microsoft Visual Basic Web site.
For More Information* The SetupWizard is introduced in "Distributing Your Application," in the *Visual Basic Programmer's Guide.