The USysRegInfo Help Topic in Microsoft Access for Windows 95

Microsoft Corporation

October 1995

Abstract

This document contains information from the USysRegInfo Help topic in Microsoft® Access for Windows® 95. To locate this topic online, search for "Usys" and then "USysRegInfo" by using the Microsoft Access for Windows 95 Help Index.

Values Used to Register an Add-in with the USysRegInfo Table

When developing your own add-in (a wizard, builder, or menu add-in), you must set several database properties and create a USysRegInfo table in the add-in database (*.mda) so that the add-in can be installed by using the Add-in Manager. For information about what database properties to define and how to import a sample copy of the USysRegInfo table, see Chapter 16, "Creating Wizards, Builders, and Add-ins" in the "Building Applications with Microsoft Access for Windows 95" manual. After you have imported a copy of the USysRegInfo table from Wztool70.mda, define the values in the records as described in the following sections.

First Record: Creating the Registry Key

The value in the Subkey field defines the names of the subkeys that will be created in the Windows Registry to register the add-in. This value must be the same for all records in the USysRegInfo table. The format of this entry depends on the type of add-in you're installing. For the first record of any add-in that you install, however, the value in the Type field must be 0 (which means "add this key"), and the ValName and Value fields must be left blank. The beginning of the Subkey entry can be either HKEY_CURRENT_ACCESS_PROFILE or HKEY_LOCAL_MACHINE. If you use HKEY_CURRENT_ACCESS_PROFILE and the installation is using a user profile (an alternate set of Registry keys that is invoked when Microsoft Access is started with the /Profile command-line option), the Add-in Manager will add the keys and values required to register the add-in in the user profile. If you use HKEY_CURRENT_ACCESS_PROFILE and a user profile is not in use, the Add-in Manager will add the keys and values required to register the add-in in the appropriate key below HKEY_LOCAL_MACHINE. If you use HKEY_LOCAL_MACHINE, the keys and values to register the add-in will always be written below HKEY_LOCAL_MACHINE.

Subkey Format for Control Wizards, or OLE Custom Control Wizards, or Builders

A control wizard is invoked from the toolbox when you click one of the control tools while designing a form or report. A builder is invoked when you click the Build button next to a property box. An OLE custom control wizard is invoked when you add an OLE custom control by clicking Custom Control on the Insert menu. To register a control wizard, a builder, or an OLE custom control wizard, the format for the Subkey field is:

HKEY_CURRENT_ACCESS_PROFILE\Wizards\WizardType\WizardSubType\WizardName

The first part can be either HKEY_CURRENT_ACCESS_PROFILE or HKEY_LOCAL_MACHINE, as described earlier. The second part must be Wizards. Assuming there is no user profile in use, this will cause the Add-in Manager to write the keys and values to register the wizard or builder in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Access\7.0\Wizards. WizardType defines whether the add-in is a control wizard, a builder (called a Property Wizard in the Registry), or an OLE custom control wizard. WizardSubType defines the specific type of wizard. WizardName is the name of the key where the values to register the wizard or builder will be written. Note that WizardName must follow the Microsoft Access object-naming rules. The following table describes the possible values for WizardType and WizardSubType.

WizardType WizardSubType
Control Wizards The name of the control in the toolbox with which you want to associate your wizard. The names of the controls are Label, TextBox, OptionGroup, ToggleButton, OptionButton, CheckBox, ComboBox, ListBox, CommandButton, Image, UnboundObjectFrame, BoundObjectFrame, PageBreak, SubformSubreport, Line, and Rectangle.
Property Wizards The name of the property with which you want the builder to be associated. This must be the name of the property with no spaces. For example, the names entered for standard Microsoft Access builders are BackColor, BorderColor, FieldName, ForeColor, InputMask, LinkChildFields, LinkMasterFields, MenuBar, ODBCConnectStr, Picture, and ShortcutMenuBar.
OLE CUSTOM CONTROL WIZARDS (must be all uppercase) The value for the Class property of the OLE custom control. To see this value, open a form or report in Design view, use the right mouse button to click the OLE custom control, click Properties, and then read the value in the Class box. For example, DBOutl.DataOutline is the value of the Class property for the Microsoft Data Outline Control 1.1 included with Microsoft Access.

Subkey Format for Object Wizards

An object wizard is used to create a table, query, form, or report. An object wizard is invoked by clicking its name in the corresponding New Object dialog box. When you are registering an object wizard, the format for the Subkey field is:

HKEY_CURRENT_ACCESS_PROFILE\Wizards\WizardType\WizardName

The first part can be either HKEY_CURRENT_ACCESS_PROFILE or HKEY_LOCAL_MACHINE, as described earlier. The second part must be Wizards. Assuming there is no user profile in use, this will cause the Add-in Manager to write the keys and values to register the wizard in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Access\7.0\Wizards. WizardType defines what kind of object wizard is being installed. WizardName is the name that appears in the corresponding New Object dialog box and is also the name of the key where the values to register the wizard will be written. The following table describes the possible values for WizardType and WizardName:

WizardType WizardName
Form Wizards User-defined. The name you enter will appear in the New Form dialog box. For example, the names entered for standard Microsoft Access form wizards are AutoForm: Columnar, AutoForm: Datasheet, AutoForm: Tabular, Chart Wizard, Form Wizard, and PivotTable Wizard.
Query Wizards User-defined. The name you enter will appear in the New Query dialog box. For example, the names entered for standard Microsoft Access query wizards are Crosstab Query Wizard, Find Duplicates Query Wizard, Find Unmatched Query Wizard, and Simple Query Wizard.
Report Wizards User-defined. The name you enter will appear in the New Report dialog box. For example, the names entered for standard Microsoft Access report wizards are AutoReport: Columnar, AutoReport: Tabular, Chart Wizard, Label Wizard, and Report Wizard.
Table Wizards User-defined. The name you enter will appear in the New Table dialog box. For example, the name entered for the standard Microsoft Access table wizard is Table Wizard.

Subkey Format for Menu Add-ins

A menu add-in is invoked by clicking its name on the Add-ins submenu on the Tools menu.

HKEY_CURRENT_ACCESS_PROFILE\Menu Add-Ins\MenuAddInName

The first part can be either HKEY_CURRENT_ACCESS_PROFILE or HKEY_LOCAL_MACHINE, as described earlier. The second part must be Menu Add-Ins. Assuming there is no user profile in use, this will cause the Add-in Manager to write the keys and values to register the menu add-in in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Access\7.0\Menu Add-Ins. MenuAddInName defines the name that appears on the Add-ins submenu and is also the name of the key where the values to register the add-in will be written. To define an access key for the menu add-in so that you can use the keyboard to choose the menu add-in, type an ampersand (&) before the letter that you want to be the access key.

Second and Subsequent Records: Adding Records to Create Values

The first record in the USysRegInfo table creates a key or keys used to register your add-in. Each record following the first record defines a value written to the last key in the subtree. The value in the Subkey field must be the same as the entry for the first record. The value in the Type field defines the type of the value created in the Windows Registry: 1 to create a String (REG_SZ in Windows NT) or 4 to create a DWORD (REG_DWORD in Windows NT). The value in the ValName field defines the name of the value. The value in the Value field defines the value itself. The number of records you need to add depends on the type of add-in you are registering. The following tables define the records you need to add for each type of add-in.

Records Required to Define Values for Control Wizards, OLE Custom Control Wizards, or Builders

Subkey Type ValName Value
Same as first record 4 Can edit Defines whether a wizard or builder can be used to modify an existing control or property of the same type. 1=Yes, 0=No
Same as first record 1 Description User-defined. If more than one wizard has been defined for a control, or more than one builder has been defined for a property, this string will appear in the Choose Builder dialog box to enable users to select which wizard or builder to use.
Same as first record 1 Function The function used to start the wizard or builder.
Same as first record 1 Library Defines the path and name of the add-in database: |ACCDIR\MyAddInDb.mda. The first part is always the same. The Add-in Manager will substitute the path to the folder where Microsoft Access is installed.

Records to Define Values for Object Wizards

Subkey Type ValName Value
Same as first record 1 Bitmap Defines the path to the bitmap (.bmp) that appears above the Description on the left side of the New Object dialog box when the wizard is selected.
Same as first record 4 Data source required Enter this record for form and report wizards only. Defines whether the user must choose a table or query from the "Choose The Table Or Query Where The Object's Data Comes From" box in the New Object dialog box before running the wizard. 1=Yes, 0=No
Same as first record 1 Description User-defined. Defines the text that appears on the left side of the New Object dialog box when the wizard is selected.
Same as first record 1 Function The function used to start the wizard or builder.
Same as first record 4 Index Defines the order in which the wizard appears in the list in the New Object dialog box, where 0 is the first item in the list.
Same as first record 1 Library Defines the path and name of the add-in database: |ACCDIR\MyAddInDb.mda. The first part is always the same. The Add-in Manager will substitute the path to the folder where Microsoft Access is installed.

Records to Define Values for Menu Add-ins

Subkey Type ValName Value
Same as first record 1 Expression The function used to start the wizard or builder formatted as an expression: =MyAddIn_Entry()
Same as first record 1 Library Defines the path and name of the add-in database: |ACCDIR\MyAddInDb.mda. The first part is always the same. The Add-in Manager will substitute the path to the folder where Microsoft Access is installed.