COM events
COM events
How do I handle an event raised by a COM object? I made a dll in VB that raises an event but I don't know how to handle it in MM. I'm using 2.3.1.834.
First of all, there are two types of events implemented in MM - one special type that is needed for scripting, because vbs or js scripts cannot implement standard COM events. The second event are standard COM events (that's what are you talking about). These are implemented in a standard way in MM, i.e. you can use them as from any other COM object. I don't know exactly VB specifics about this, but you can definitely find examples by Google. Let us know should you have any further problem with this...
Jiri
Jiri
The <script> tags didn't work, got a parse error like I expected.
So far everything I've been reading points to the host application, MM in this case, providing some interface to an object's events. For example, Windows Script Host (WSH) provides the CreateObject method which has a parameter that lets you specify a prefix and WSH will use that and the event name to determine a procedure in your script to call, e.g. ObjectName_EventName. IE uses the script tags method I mentioned earlier. VB has the WithEvents keyword that's used when an object is declared, for example Dim WithEvents object as Someobject, and then later on it calls a procedure of the form ObjectName_EventName. Some script hosts, like ASP, simply don't provide any way of handling COM events.
Since handling events is different in every script host can you list any examples of handling events via script in MM?
So far everything I've been reading points to the host application, MM in this case, providing some interface to an object's events. For example, Windows Script Host (WSH) provides the CreateObject method which has a parameter that lets you specify a prefix and WSH will use that and the event name to determine a procedure in your script to call, e.g. ObjectName_EventName. IE uses the script tags method I mentioned earlier. VB has the WithEvents keyword that's used when an object is declared, for example Dim WithEvents object as Someobject, and then later on it calls a procedure of the form ObjectName_EventName. Some script hosts, like ASP, simply don't provide any way of handling COM events.
Since handling events is different in every script host can you list any examples of handling events via script in MM?