Office中国论坛/Access中国论坛

标题: 【转载 / 资料】如何将MDE制作成加载项(英文) [打印本页]

作者: LucasLynn    时间: 2005-8-31 01:23
标题: 【转载 / 资料】如何将MDE制作成加载项(英文)






Creating the USysRegInfo Table for a Microsoft Access 2000 Add-In


  





Microsoft Corporation


January 1999


Summary: This document contains information about creating the USysRegInfo table required by the Microsoft® Access Add-in Manager to install and manage an add-in. (10 printed pages)


Creating the USysRegInfo Table


When developing your own add-in (a wizard, builder, or menu add-in), you must create a table named USysRegInfo in the add-in database (*.mda or *.mde) so that the add-in can be installed by using the Add-in Manager. You can create a new USysRegInfo table from scratch or import one from another add-in.


The USysRegInfo table is usually a hidden table, because it provides information to the system but doesn't contribute to other data in the database. To mark the USysRegInfo table as a hidden object, right-click the table in the Database window, click Properties on the shortcut menu, and select the Hidden check box.


The following table describes the fields that must be included in the USysRegInfo table:











Field name


Data type


Description





Subkey


Text


The name of the subkey that the Add-In Manager will create in the registry for your add-in.





Type


Number


Defines the type of the value created in the registry: Use 0 to create a subkey, 1 to create a String, or 4 to create a DWORD.





ValName


Text


The name of the entry to be created in the registry.





Value


Text


The value to be stored in the registry entry defined in the ValName field.


The USysRegInfo table can contain information for multiple add-ins.


The First Record: Creating the Registry Key


The value in the Subkey field defines the name of the subkey 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 describing that add-in.


No matter what kind of add-in you're installing, the value in the Type field must be 0 for the first record. This value specifies that the subkey is to be added to the registry. Also, the ValName and Value fields must be left blank for the first record. 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 start Microsoft Access by using an Access user profile (an alternate set of registry subkeys that is invoked when Microsoft Access is started with the /profile command-line option), the Add-in Manager will add the subkeys and values required to register the add-in in the Access user profile. In this case, the registry subkeys are written to the following subkey:HKEY_LOCAL_MACHINE\SOFTWARE\CompanyName\ApplicationName\ApplicationVersion


\WizardType\WizardName





Note   A user profile that you use to start Microsoft Access from the command line is not the same thing as a user profile defined for logging into the operating system. An Access user profile applies only to Microsoft Access, and only when you start Access from the command line. A user profile defined for the operating system applies to every application on the operating system and is used to maintain system data for individual users.


If you use HKEY_CURRENT_ACCESS_PROFILE and an Access user profile is not in use, the Add-in Manager will add t
作者: LucasLynn    时间: 2005-8-31 01:23
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 subkeys and values to register the menu add-in in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\9.0\Access\Menu Add-Ins. MenuAddInName defines the name that displays on the Add-ins submenu and is also the name of the subkey 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 subkey or subkeys used to register your add-in. Each record following the first record defines a value written to the last subkey 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 registry: 1 to create a String or 4 to create a DWORD. 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, ActiveX Control Wizards, or Builders











Subkey field value


Type field value


ValName field value


Value field value





Same as first record


4


Can Edit


Defines if 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 be displayed 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, which can be an .mda or .mde file. For example:


|ACCDIR\MyAddIn.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 field value


Type field value


ValName field value


Value field value





Same as first record


1


Bitmap


Defines the path to the bitmap (.bmp) that is displayed above the description on the left side of the New Object dialog box when the wizard is selected.





Same as first record


4<
作者: LucasLynn    时间: 2005-8-31 01:24
帖子的长度限制能不能放宽一点啊,很多技术资料不能切割,一切就出现代码需要用户验证。

[此贴子已经被作者于2005-8-30 17:29:49编辑过]


作者: LucasLynn    时间: 2005-8-31 04:19
ACC2000: Converted Add-In Not Displayed in Access Project


View products that this article applies to.














Article ID


:


199316





Last Review


:


June 24, 2004





Revision


:


1.0


This article was previously published under Q199316


Moderate: Requires basic macro, coding, and interoperability skills.





This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).











On This Page



































SYMPTOMS








CAUSE








RESOLUTION








MORE INFORMATION











Steps To Reproduce Behavior








REFERENCES








APPLIES TO





SYMPTOMS


If you use a converted Microsoft Access 97 add-in in Access 2000, the add-in appears on the Add-Ins menu of an Access database (.MDB ), but not in an Access project (.ADP).

















Back to the top


CAUSE


In Access 97, each add-in contains a table called USysRegInfo. USysRegInfo contains three entries (r




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3