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:
A 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:
The 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 StringsMicrosoft DAO 3.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:
Additional query words: 4.00 vb4win vb4all listbox combobox dropdown
Keywords : IAPOLE |
Last Reviewed: September 17, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |