Hi,
after two failed attempts to create something useful for WME, I have created something that is releasable and hopefully useful.
WMECom is a plugin that adds COM Automation support to WME scripting. There are a lot of applications and libraries out there that support COM/OLE, e.g. MS Office or MS XML, and these can now be used within WME (with reasonable limitations). See below for an example, that uses MS XML to create an XML document.
Update:Version 1.01:
- fixed bug where IDispatch properties were returned as boolean (probably a bug in WME)
- removed 9 parameter limitation from function calls
WMECom 1.01There is a short ReadMe in the package, but I had no time (or inclination
) to write a complete documentation. The sample shows every feature of the plugin. And if you have questions, don't hesitate to ask me. I will try to help as best as I can.
Greetings
Banbury
// this class initializes COM support and has to be a created once (and only once) before you can use any other COM object
var com = new WMECom();
// Create a new COM object
var xml = new WMEComObject("MSXML2.DomDocument");
// This variable holds the original pointer to the node
var node = xml.createElement("Node1");
// and it is passed to the function without wrapping
xml.appendChild(node);
// We have to wrap it here, before we can use properties and functions.
var o_node = new WMEComObject(node);
o_node.text = "This is a new node.";
Game.LOG(xml.xml);
// Objects of type WMEComObject should be released when no longer needed.
o_node.Release();
xml.Release();