Cicode Programming Reference > Cicode Function Categories > ActiveX Objects Introduction > ObjectIsValid

ObjectIsValid

Determines if the given handle for an object is a valid handle. This function is useful for programmatically checking that an object was returned for a call.

Syntax

ObjectIsValid(hObject)

hObject:

The handle for the object (as returned by the ObjectByName() function).

Return Value

0 if the handle is not valid, otherwise 1.

Related Functions

ObjectByName, CreateObject, CreateControlObject

Example

hFont = _ObjectGetProperty(hControl, "Font");
IF ObjectIsValid(hFont) THEN
_ObjectSetProperty(hFont, "Size", 22)
END

See Also

ActiveX Functions