How to Programatically List .VCX File's Class DefinitionsID: Q129512 3.00 WINDOWS
The information in this article applies to:
SUMMARYA Visual Class Library (VCX) contains references to classes. This article provides two methods that will allow you to list the name of the classes contained in a class library.
MORE INFORMATIONThe Visual Class designer provides an interface that allows you to create classes visually. The class definitions are stored in a table with a .VCX extension. Although there is no native Visual FoxPro command that will allow you to list all the classes saved in a .VCX file, there are ways to retrieve this information.
Use the VCX as a TableA VCX is a FoxPro table, so you can open it with the USE command, and you can manipulate the table as if it were a .DBF file. When a class is created, a new record is added for each object that belongs to the class. Additionally, the first record for the class contains information about the class definition, and the Reserved1 field of the .VCX file contains the word "Class" to tag a class definition. It is therefore possible to query the table for these records that have the Class string in the Reserved1 field. The following example queries the LOGIN.VCX file located in the SAMPLES\MAINSAMP\LIBS directory; it retrieves the name of class definitions.
Use the Class BrowserIn development mode, you can use the Class Browser to list the classes in a .VCX file. To do so: 1. Run the Class Browser and open the VCX you need. You can open the Class 2. Run the following code. When the Class Browser is loaded, the _Obrowser
REFERENCESFor more information about the Class Browser, search for "_BROWSER" and "Sample Files" topics in the Visual FoxPro Help menu. Additional reference words: 3.00 VFoxWin KBCategory: KBSubcategory: FxprgClassoop
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |