Wednesday, February 15, 2012 4:08 PM
I'm writing a JScript that opens an xml document using an ActiveXObject Microsoft.XMLDOM. And as I understand it, JScript uses auto-garbage collection, so that all dynamically allocated objects are deleted on script exit. The thing is, I am running this JScript from the Windows Speech Recognition Macros (WSR Macros) application environment.
My code runs fine the first time, but when I rerun the WSR macro, it either tells me "The process cannot access the file because it is being used by another process", or if I run with a different request, the dom document keeps the previous request data.
I am thinking that this might be because WSR Macros application might not interface with the .NET JScript parser/engine correctly (I have a very limited understanding of the .NET framework). Possibly because it does not handle script exiting particularly well?
My question is, is there a way to explicitly delete (or reinitialise to null/empty) an ActiveXObject (dom object) in JScript.
// Create dom document, load and parse xml
guard_xml_doc = new ActiveXObject("Microsoft.XMLDOM");
guard_xml_doc.async = false;
load_ok = guard_xml_doc.load("C:\\Users\\Dr Mac\\Documents\\My
if (load_ok != true)
Any help would be greatly appreciated, thnx, Bruce.
Monday, March 12, 2012 6:29 AM
Please check the following reference, hope could make some help,