How to Specify Informational Text for VB4 OLE ServersLast reviewed: April 4, 1996Article ID: Q149047 |
The information in this article applies to:
SUMMARYOLE automation servers created with Visual Basic 4.0 can expose informational text in various places to enable OLE automation clients to identify and use them easily. The actual strings that are viewable from an OLE automation client can be set within the Visual Basic OLE server project. This article outlines the places that the information should be entered and modified, as well as where it will appear in external locations.
MORE INFORMATIONThe two locations within Visual Basic where these settings can be changed are the Project tab of the Options dialog box and the Member Options dialog box available from the Object Browser. The Project tab contains both Project Name and Application Description text boxes. If a class module is selected in the Object Browser, pressing the Options button will display a dialog box containing a Description text box.
Project Name in OptionsThe Project Name field in the Options dialog box contains the first part of what is known as the programmatic ID or ProgID of any class exposed by the OLE server. The class name (as specified in the Properties window for the class module) provides the second part of the ProgID. For example, assuming the string MyOLEServerProj was entered in the Project Name field, and a public class module existed in that project with the name MyPublicClass, then the ProgID for that class would be:
MyOLEServerProj.MyPublicClassA key with this entry will be made in the HKEY_CLASSES_ROOT predefined key in the registry when the project is compiled to an executable or run in the design environment. OLE uses this registry key to determine what server to use when anyone attempts to create an object from an OLE automation client. If multiple public classes exist in a project, there will be multiple entries made to the registry containing the same initial identifier. For example, given MyPublicClass1, MyPublicClass2, and MyPublicClass3, the following three keys would be created in the registry:
MyOLEServerProj.MyPublicClass1 MyOLEServerProj.MyPublicClass2 MyOLEServerProj.MyPublicClass3The Project Name string is also used as the name of the library or project in the Libraries/Projects drop-down combo box displayed by the Object Browser.
Application Description in OptionsThe Application Description field in the Options dialog box provides a location to specify a single string identifying the OLE server. The string entered in the Application Description text box will be displayed in the References dialog box by Visual Basic 4.0 (and other VBA clients). This string will be displayed as an entry in the Available References list box and as the title of the frame below the list box that shows location and language information for the selected OLE server. If the Application Description text box has been left blank, Visual Basic will use the string in the Project Name field as a replacement. The Application Description string will also be used by the Object Browser as the description for the OLE server in the Libraries/Projects drop-down combo box. The application description information is compiled into the type library that is part of each server EXE or DLL generated by Visual Basic 4.0. Any client that is written to query type libraries for this information will be able to retrieve and display it. When the References dialog box is opened, Visual Basic is doing exactly that: its running through all registered classes and retrieving this information for display in the References dialog box.
Example Application Description Strings
Microsoft DAO 3.0 Object Library Microsoft Visual Basic 4.0 Development Environment OLE/Messaging 1.0 Object LibraryAdditional examples can be seen by simply viewing the entries in the References dialog box.
Description in Object Browser Options Dialog BoxAfter displaying the Object Browser and selecting a class module in the Classes/Modules list box, the button on the Object Browser labeled Options is enabled. Pressing this button displays the Member Options dialog box. This dialog box can be used to set and modify the descriptions for both a class module in general and also specifically for each public member (function, subroutine, or property) of the class module. This information will be used by the Object Browser to display a help string for the selected class or the selected member of a class. This string is displayed at the bottom of the Object Browser dialog box. Follow these steps to see an example of this behavior:
The Help Context ID field in the Member options dialog box can be utilized to link a specific part of a help file to each class module and public member. The entry listed in the Help File label is whatever help file has been specified in the Help File section of the Project Tab of the Options dialog box. For more information on how to provide help in this manner, see the online help and the Visual Basic 4.0 manuals.
|
Additional reference words: 4.00 vb4win vb4all listbox combobox dropdown
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |