Assign multiple pointers to the same OLE object
- Last UpdatedJul 24, 2024
- 1 minute read
In a script, you can assign multiple pointers to the same OLE object by using the equals sign.
Syntax
%newpointer = %pointer
Arguments
%pointer
The name of the pointer that already references a created OLE object.
%newpointer
The name of a new pointer that should reference the same OLE object. It can contain alphanumeric characters (A-Z, 0-9) and underscore. It is case-insensitive.
Example(s)
This script creates an OLE object based on the Wscript.Shell class and creates a pointer %WS to reference it. The pointer %WS2 when set to %WS points to the same OLE object. It can be used to read from or write to properties and call methods of the same OLE object.
OLE_CreateObject(%WS,"Wscript.Shell");
%WS2=%WS;
Note: You can use message tagnames in connection with pointers. If you assign a message tagname to a pointer, it can get an ID value. You can use it to create more pointers to the same OLE object.