613-518-1166 info@zimdatabases.com

ZIM Language Reference

$ObjCreate

< All Topics

$ObjCreate

Creates the named ActiveX object.

Syntax

$ObjCreate (ProgId)

Parameters

ProgId

a string or an expression that evaluates to a string

Return Value

Returns an object that can be assigned to a variable of type object.

Comments

An ActiveX or COM object is identified by a GUID (a globally unique number). A ProgId identifies a COM object with a meaningful name. It looks like vendor.component.version or vendor.component.

When you assign to an Object variable using $ObjCreate, the existing COM object referenced by the Object variable (if any) is released.

Before your program terminates, it’s a good idea to set any Object variables to $Null, so that the objects your program used can be released.  Otherwise, even after your program terminates, because the Zim variables still exist and still reference the COM objects you used, the objects will still be active and consuming memory and resources.

This does not apply to the OLE control form variable, since when the form is closed the OLE control is automatically released, but it does apply to any objects returned from an OLE control via $ ObjRunMethod or $ ObjGetProperty.

See Also

Adding Component Objects to Zim Forms

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Table of Contents