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.

OLEClass

Specifies the name of the server that created and is responsible for the current OLE bound or unbound control.

Usage

cName = oControl.OLECLass

OLEClass contains the name of the server through which the OLEControl’s data was created, and which will be called up again if the object needs to be redisplayed, edited or played. This name should exactly match a key entry in the Registry.

OLEClass is read-only once the object has been created. It would be nice to just move items around from server to server, but because each is responsible for its own methods of data storage, this isn’t possible with current OLE technology. We think if a BMP is a BMP, just because it has been embedded or linked into a control by one app, we shouldn’t be prevented from getting at it with any other BMP-compatible program. Maybe we’ll see some improvement in OLE 3.0.

For OLEControls, OLEClass is specified during the creation process using the DEFINE CLASS command, or with the visual tools by selecting the data file to create or add to the control when placing it on a form. For OLEBoundControls, OLEClass is determined by the field to which it’s bound. The field’s OLE class, in turn, is set when it’s populated with data using the APPEND GENERAL command

Example

DEFINE CLASS myPaint AS OLEControl
  OLEClass = "Paint.Picture"
ENDDEFINE

? oControl.OLEClass

APPEND GENERAL gData FROM "C:\WINDOWS\CANYON.MID"
* an OLEBoundControl associated with this field yields
? olbGData.OLEClass  && displays "midfile"

See Also

Append General, Registration Database, OLEBoundControl, OLEControl