Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: lubos on October 21, 2009, 10:09:33 pm
-
Hi,
this line is valid in Scripter for JScript
var xmlDOM = new ActiveXObject( "MSXML2.DOMDocument.4.0" );
but it's not valid for JavaScript.
What I have to write to use any COM object using JavaScript?
Thanks for any hint.
-
You can't.
JScript uses the Windows scripting engine which enables access to ActiveX and COM.
JAVAScript does not.
Oliver
-
Oliver is correct that it is not supported natively by JavaScript. We do provide a COM wrapper library though that is accessible from JavaScripts within the EA JavaScript engine.
To create a COM object, the syntax for named objects is:
var obj = new COMObject("WMPlayer.OCX");
or for ClsIDs
var obj = new COMObject("{6BF52A4F-394A-11D3-B153-00C04F79FAA6}");
Please note the curly braces ({}) are required for ClsIDs.