While banging my head against the wall again over this annoyance, it occured to me that there may be a possible solution, though I am unsure if it could work.. The obvious first question is, "If something else creates an object, can your own code recieve events from it?"
Now why is this a meaningful question? Because instead of implementing a full on handler for dealing with objects, and this making CreateObject or New on the script useless. It occured to me that you may be able to make a command like:
DriveEvents (Long ObjectHnl, BSTR ObjectName)
This bit of code would read the information for the object, looking for events. If for instance the object had an Image, an OK button and a Cancel button (and the object had events for them), then the code would create event names: ObjectName_OnClickImage, ObjectName_OnClickOK and ObjectName_OnClickCancel. As long as the guy making a plugin for Mushclient remembered to include a DriveEvent command for the ActiveX program he was using, the event driving code would automatically look for the correct subs to call when they happened.
Anyway, this is my working theory and it is slightly less potentially bloating that a complete object handler that had to intecept every property, function call, etc. for the object, not to mention handling its creation and destruction. There has to be some easy solution to this annoyance... :p
Now why is this a meaningful question? Because instead of implementing a full on handler for dealing with objects, and this making CreateObject or New on the script useless. It occured to me that you may be able to make a command like:
DriveEvents (Long ObjectHnl, BSTR ObjectName)
This bit of code would read the information for the object, looking for events. If for instance the object had an Image, an OK button and a Cancel button (and the object had events for them), then the code would create event names: ObjectName_OnClickImage, ObjectName_OnClickOK and ObjectName_OnClickCancel. As long as the guy making a plugin for Mushclient remembered to include a DriveEvent command for the ActiveX program he was using, the event driving code would automatically look for the correct subs to call when they happened.
Anyway, this is my working theory and it is slightly less potentially bloating that a complete object handler that had to intecept every property, function call, etc. for the object, not to mention handling its creation and destruction. There has to be some easy solution to this annoyance... :p