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.

ClassLibrary

This property contains the name of the class library (VCX) containing the class definition that an object is based on. It’s the library containing the definition for the object’s Class.

Usage

cClassLibrary = oObject.ClassLibrary

You can look, but you can’t touch. This one is read-only all the time. Intrepid hackers may think that diddling with this field at the SCX or VCX level is the only way to directly switch an object from one class hierarchy to another. We prefer not messing with the underlying power tool tables directly whenever possible (and then only with lots of backups!).

We suggest two alternatives. First, you can use the Class Browser’s Redefine function to do this sort of thing. The other alternative is to query an existing object at design-time and create a matching object with appropriate properties, events and methods, then delete the original object. A perfect job for a Builder! See “Builders and Wizards (and Bears, Oh My!)” in the “But Wait, There’s More!” section.

ClassLibrary contains the full path to the library.

Example

IF cmdQuit.ClassLibrary = cmdSave.ClassLibrary
   WAIT WINDOW "Hey, we're brothers!"
ENDIF

See Also

Class, Set ClassLib