Handling COM Events from script
-
If I have a component, that's not an activeX control, that implements connection points, how do I recieve the events from script? I'd like to do something like the following :
Dim obj
Set obj = CreateObject("XYZ.SomeObject")Sub ISomeObject_OnSomethingHappened()
'Event was fired, handle it...
End SubAnother example is MSXML. The MSXML DOM implements events that can be handled from script. How is this done?
var xmldoc;
function Load()
{
xmldoc = new ActiveXObject("MSXML2.DOMDocument.4.0");
xmldoc.onreadystatechange = CheckState; <<-- How do I implement this functionality in my component???
xmldoc.load(URL.value);
}
function CheckState()
{
// Handle readystatechange events..
}Thanks....
-
If I have a component, that's not an activeX control, that implements connection points, how do I recieve the events from script? I'd like to do something like the following :
Dim obj
Set obj = CreateObject("XYZ.SomeObject")Sub ISomeObject_OnSomethingHappened()
'Event was fired, handle it...
End SubAnother example is MSXML. The MSXML DOM implements events that can be handled from script. How is this done?
var xmldoc;
function Load()
{
xmldoc = new ActiveXObject("MSXML2.DOMDocument.4.0");
xmldoc.onreadystatechange = CheckState; <<-- How do I implement this functionality in my component???
xmldoc.load(URL.value);
}
function CheckState()
{
// Handle readystatechange events..
}Thanks....
This is a problem I'm having that is along similar lines to Gerald, I'm trying to use events that are implemented in a com server I created, using JavaScript. I have already implemented a Visual Basic application that works fine with it, and handles the events from the server, so I am confident that the server works fine. I have also implemented HTML and JavaScript that connects to the sever throught the tags, and it can call functions, and use properties from it, but I can't get it to handle the events from it using tags. Does anyone know if there is there anything specific I have to implement in the Server, or the JavaScript to make this work? Cheers, Dave.</x-turndown>