How To Use Config.fpw Files with OLE Automation ServersLast reviewed: October 29, 1996Article ID: Q157402 |
The information in this article applies to:
SUMMARYThis article describes how to reference specific configuration variables when Visual FoxPro is set up as an OLE Automation Server. When you define an OLE server, you can either reference the Visual FoxPro Application object or create custom OLE classes. These two types of OLE objects require different methods to read environment settings.
MORE INFORMATIONVisual FoxPro exposes FoxPro as an OLE server. The Application object provides the top level of the hierarchy. For example, in an OLE client application, you can run the following command to create an OLE object:
CREATEOBJECT("VisualFoxPro.Application")If you are referencing the VisualFoxPro.Application object, the normal configuration file conventions are adopted since an instance of Vfp.exe is launched (assuming you use CreateObject() and not GetObject()). This means it references the Config.fpw file in the default directory, or you can add to a registry key the -C startup switch that specifies the path to the Config.fpw file. The registry key to modify follows:
HKEY_CLASSES_ROOT\CLSID\{GUID}\LocalServer32The GUID is different for every install of Visual FoxPro. The Value of this key is as follows:
C:\VFP5\VFP.EXE /automation -CC:\CONFIG.FPWWhen you create your own custom OLE Automation servers, the OLE classes you create are delivered in either a .dll or an .exe file. Before you build the .exe or .dll, add the Config.fpw file into the project and make sure it is marked as included. At run time, the Config.fpw that resides inside of the .exe or .dll file is used. To specify a different Config.fpw file once an OLE Automation Server is distributed, you can use the same procedure as above and modify the registry key for the OLE server. NOTE: If you have included the Config.fpw file in the project, the -C switch is ignored.
|
KBCategory: kbusage kbprg kbinterop kbole kbhowto
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |