$ObjCreate

$ObjCreate

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

$ObjCreate

Creates the named ActiveX object.

Syntax

$ObjCreate (ProgId)

Parameters

ProgIda 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.

Warning

COM objects are being discontinued by Microsoft and may not be available in future releases of Zim-X.

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_CAEnglish