This sample shows how to access the Windows Registry using the native Visual FoxPro DECLARE-DLL command. The Windows API provides a number of functions you can use to access, read and write to the registry. The Registry.prg class library in ...\Samples\Classes contains a class definition that exposes these functions as methods that you can call in your applications.
The Registry contains a listing of all installed ODBC drivers and data sources. If your application relies on using ODBC, then you might want to perform a Registry check to see if a particular driver or data source is installed. This sample shows how to query for ODBC information.
LOCAL oReg,regfile,nErrNum,lDrivers PUBLIC aODBCData regfile = HOME(2)+"classes\registry.prg" SET PROCEDURE TO (m.regfile) ADDITIVE oReg = CreateObject("ODBCReg") DIMENSION aODBCData m.nErrNum = oReg.GetODBCDrvrs(@aODBCData)