DADiSP Worksheet Functions > Function Categories > ActiveX > Automation Client > GETOBJECT
Returns a handle to a running ActiveX server object.
GETOBJECT("objname")
"objname" |
- |
A string, the name of the ActiveX object. |
A handle to the running object or –1 if an error occurs.
Word = getobject("word.application");
Word.visible = 1;
Connects to the running MS word as an ActiveX server and makes Word visible.
GETOBJECT connects to a running ActiveX object as a server. Once connected, any methods or properties supported by the object can be invoked, set or queried. Use CREATEOBJECT to connect to a server that is not already running.
If objname is unspecified, GETOBJECT connects to the current running instance of DADiSP. For example:
dadisp = getobject();
dadisp.getdata("version")
Displays the current version of the running DADiSP.
Each running instance of DADiSP registers a unique name so that an ActiveX client can connect to a specific instance. The name is of the form:
DADiSP Automation Server:pid
Where pid is an integer, the process identification number. For example:
DADiSP = getobject("DADiSP Automation Server:1748");
connects to the running instance of DADiSP with process id 1748. See GETEXENAME to return the automation server name.
A simple procedure to connect one running instance of DADiSP with another:
In DADiSP 1:
copydata(getexename(2));
In DADiSP 2:
dadisp1 = getobject(pastedata(3));
Now DADiSP 2 can access DADiSP 1 via the dadisp1 object.