Setting Project Properties VB Help

This point, we’ll take a bleak to discuss the Project Properties dialog box. most of the entries in this dialog box are obvious, but some aren’t. Also, some seemingly obvious options may have ramifications you must be aware of. You can’ skip The project Properties dialog box, shown in Figure 15.5: lets you select a project type and set various options for the project. The tabs of the dialog box are explained .next

The General tab of the .
Project PropertIes window

.FIGURE .15.5:

.FIGURE .15.5:

General tab

Project Type This list contains the types of projects as they appear in the File Open dialog box. The project types available in this list are EXE ActiveX DLL ActiveX EXE and ActiveX control. Changing the proje(t type when you want to isn’t always feasible, or simple but many times it is. Switching between ActiveX DLL and Standard EXE projects is possible and fairly easy. Let’s say you want to build an ActiveX OLL. To simplify the testing and debugging process you can start a Standard EXE project and add a Class Module to the project. When the Class is working in the context of the current project you can remove the project’s Forms and change the type of the project from Standard EXE to ActiveX OLL. After the DLL has been created and registered (as explained in the section “Registering a Component” later in this chapter) you can use the Class from within any project.

Startup Object This entry lets you specify what will happen when the
,project runs. ActiveX DLL and EXE projects can’t be executed the ActivcX component must be called from within a Standard EXE project’s code. For Standard EXE projects, the start-up object can be a Form or the subroutine Main. The Main subroutine must reside-in a standard Module of the project and i~must bring up the first visible Form of the application. Code components can’t start hy displaying Forms. The start-up object of an ActivcX EXE or DlL component must be None or the subroutine Main. If you change the  of a project during its implementation you must also change’ the start up Object.

For project groups, you can set a different start-up object for each project in the group. To specify the start-up project, right-click the project’s name in the Project Window and Select  Set as Start-up.

Project’Name This property is the component’s ‘name in the Object Browser. In other words, this is how developers will locate your component in the Object Browser and look up its members: It’s important to set a proper project , name in this#field or else you’ll have to differentiate among various Project ” . components on your disk, If the component’s name is My Component and it . exposes a Class called My Class, then you must create an Object variable to reference the Class from within another application with a statement like the following one:
Set Object – create object(my Object My Class) “

As you’ve probably realized changing the project name (or the Class’ name for that matter) after the fact requires that the code be revised too. Use descriptive project names and ‘avoid generic names like Test Example or Server ActiveX components CUll registered to the system they aren’t just files that live in a folder.

Help’ File Name.Project Help Context IP These two fields let you specify the Help file for the project and the ID in this file. Although we won’t discuss ‘Help files in this book, any component you plan to release (especially ActiveX controls) ~t have-a Help file.

Project Description This is the project’s description and it appears in the Object Browser when a user selects your component

Upgrade ActiveX Controls Check this option to have Visual Basic automatically upgrade ActiveX controls to newer versions should the user upgrade one or more of the controls used in the project.

Require License Key This field enables.you to protect your components with a license key. The ActiveX exponents you will create with the process outlined here will work on any system on which they are installed. Let’s say you’ve developed a custom ActiveX DLL, which you~l use from with in your applications. The control must also be installed on the host systems that will run your application. The end users should be able to use your component at run time only. This is possible with license keys. Once you reach this level of component development, you must consult the documentation to  learn how to create license keys for your components.

Unattended Execution The options in this section apply to multi threaded EXE servers and won’t be discussed in this book. This option tells Visual Basic to skip any message boxes or other forms of input/output so that the component can be executed without user attention. If you call an ActivcX EXE component that runs on a server machine. you don’t want the component to display an input box (which you probably inserted as a debugging . aid) on the server and wait for user input forever.

Component Tab

Start Mode To this section, you can specify whether an ActiveX EXE server will start as a stand-alone application or an ActiveX server. This option applies to ActiveX EXE components only and the default option is ActiveX component.  Remote Server When ‘checked, Visual Basic creates a file with a .vbr file name extension and the same file name lIS the dll iik. This .vbr file contains information needed by the Windows Registry to run an Activex server on a remote computer.
• . Version Compatibility The options in this section allow you to set the level of version compatibility, they are: .
• No.Compatibility If this option is checked, compatibility is not
enforced
• Project Compatibility If checked, the Location box is activated which
allows you to search for the file compatible with this project. If cleared, the Location box is not available. If YOll design an ActiveX control or code component to be used with a specific project, dick this option and select the name of the project tl the last field on the tab. By default, this option is checked for all ActiveX projects so that every time you change the control or component’s code, the project· is also updated.
• Binary Compatibility Check this option to maintain compatibility
among projects that have been compiled using your component.

Posted on November 5, 2015 in Building AdiveX Components

Share the Story

Back to Top