Setting Project PropertiesBefore you compile a program, you can take a moment to set some project properties that determine how the program compiles. When you click the Options button in the Make Project dialog box (instead of clicking OK to start the compile), Visual Basic displays Figure 23.1's Project Properties dialog box. Setting project properties before compiling.
Version control refers to the capability of Visual Basic to assign version numbers, such as 1.01, 1.02, 2.00, and so on, to compiled code. If you plan to update your application in the future and distribute subsequent versions, set the Major, Minor, and Revision version number text boxes. The versioning values let you distinguish between compiled versions. You might want to place the version number in your application's Help | About dialog box.
In addition to the versioning information, consider locating an icon you want displayed on the Start menu and on the taskbar that represents your program. The only catch is that you cannot set the application's icon from the Icon list box! The Icon list box lets you select a form name from your project. If your project contains only a single form, that's the only form that appears in the list box. The form's Icon property holds the icon filename, and when you select that form in the Project Properties dialog box, its icon becomes the compiled application's icon. When you click the Project Properties dialog box's Compile tab, you'll be able to set additional properties, as shown in Figure 23.2. Additional project properties you can set. Generally, if you go to the trouble of compiling the application, you'll want to make sure the option labeled Compile to Native Code is selected. If you compile as p-code using the top option, your application will run more slowly and require a runtime .dll file that you must distribute along with your application. P-code is an interpreted language that works beneath some compiled Visual Basic applications. P-code, which stands for pseudocode, tells the system what your application wants to do next. Native code, on the other hand, is a machine language that your computer understands directly without the need for a time-consuming interpreted language such as p-code. Versions of Visual Basic before 5.0 could not compile applications into native code, so programmers had to use p-code. P-code still exists for compatibility, but you'll always want to compile into native code for the fastest execution speed your application can achieve. By clicking the Advanced Optimizations command button, you display another set of options. There is one problem with this set of options: Although they produce a more efficient running application, the application checks less for runtime errors. You will want to set one or more of these advanced options only if you have thoroughly tested your application.
|
|
![]() |
![]() |
|||