How to: Create Automation Servers

You can create Automation servers in an application project by creating an OLE public class user-defined class in a program (.prg) file or visual class library (.vcx) file.

For examples of Automation servers, see the Visual FoxPro ..\Samples\Servers directory.

To create an Automation server

  1. Create the class in the Class Designer as a Custom class.

  2. On the Class menu, click Class Info.

  3. In the Class Info dialog box, click OLE Public.

For more information, see How to: Create Classes and Subclasses.

To create an Automation server programmatically

  • Create the class using the DEFINE CLASS command and include the OLEPUBLIC keyword with the AS clause.

For example, the following code in a class definition in a program file creates a custom OLE public class:

 CopyCode imageCopy Code
DEFINE CLASS person AS CUSTOM OLEPUBLIC
   FirstName = SPACE(30)
   LastName = SPACE(45)
   PROCEDURE GetName
      RETURN THIS.FirstName + " " + THIS.LastName
   ENDPROC
ENDDEFINE

See Also


© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic