The information in this article applies to:
SUMMARYVisual FoxPro 6.0 contains the new Foundation Classes (FFC) that offer support for a wide variety of database and application functionality. One of the more important tasks of today's applications is the ability to access the Registry. The FFC includes a class library called Registry.vcx, which contains useful classes for accessing the Registry. This paper discusses ways to use these classes in your applications. MORE INFORMATIONYou can use the Registry.vcx class library included in the \FFC folder of Visual FoxPro 6.0 to access the Windows Registry. The classes included in the Registry.vcx, access the Registry by making calls using the Visual FoxPro DECLARE command to call directly into the Win23 API routines. The class library consists of the following classes: RegistryThis is the core class that contains most of the methods you need to access (read/write) the Registry. There are many useful purposes for accessing the Registry in an application.The following example goes through the Registry to obtain a list of registered ActiveX controls installed on your system. The results are stored in a public array called aControls:
FileregThis is a subclass of the Registry that has several useful methods for accessing file specific information such as path and version. The following example shows how to access both the path and version information for Excel:
FoxregThis is a subclass of the Registry and has methods that read/write to the Visual FoxPro options registry keys. These settings are saved from the Options dialog available off of the Tools menu. While most of these settings are simply mapped to SET commands, a few are only stored in the Registry (Maximum Form Design Area). The following code snippet returns the current BuilderLock setting (1 is Locked & 0 is not Locked):
OdbcregThis subclass of the Registry has functions to access ODBC keys for your applications that require this information. The following code lists to the screen all the ODBC drivers and datasources in your system.
OldiniregThis subclass of the Registry is included for backward compatibility in accessing text files that have old INI formatting.Assume that you have a copy of an old Win.ini file in your Windows directory. The following example returns the value of the device entry in the windows section of a Win.ini file:
The following example writes a value to the Run entry in the Windows
section of the Win.ini file:
REFERENCES
For additional information, please see the following Visual FoxPro Solution
samples for more details:
Additional query words: kbVFp600 kbFFC
Keywords : |
Last Reviewed: July 29, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |