Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

Server

Server is an object exposed within the Project object, to allow us to view and manipulate all of the server information within the project programmatically.

Property

Value

Purpose

CLSID

Character

The COM unique identifier used to access your server from other applications.

Description

Character

The description of the server, as entered on the Servers page of the Project Info dialog.

HelpContextID

Integer

The topic in the associated help file to be invoked from this object.

Instancing

Numeric

Determines whether the class can be instantiated and, if so, whether the same server can serve multiple applications.

ProgID

Character

The name of the class as it would be used in CreateObject().

ServerClass

Character

Returns the class name of the server.

ServerClassLibrary

Character

The Class Library where the class is defined. Returns the PRG name if the class is defined in code, or the VCX name if it was defined visually.

You can use the Server interface to examine all of the properties of COM objects within your project. Combined with the Project object and ProjectHooks, we can envision some pretty cool builders to document your application, or to use properties like the CLSID to tweak Registry settings.

Server is not a new FoxPro base class, but rather a COM interface exposed by Visual FoxPro. That means there’s no way to subclass the Server objects. Also, since the Project Manager doesn’t examine the files added to it until a build is performed, don’t expect to see new Server objects until you build the project for the first time.

Example

MODIFY PROJECT MySample NOWAIT
oProject = _VFP.ActiveProject
? oProject.Servers.Count  && Displays the # of servers available
FOR EACH oServer in oProject.Servers
  ? oServer.CLSID         && Displays the Class ID for each
NEXT

See Also

CLSID, Description, HelpContextID, Instancing, ProgID, Project, ServerClass, ServerClassLibrary, Servers