i have created a com object that raises events. one of the ways shown to test this is with a vbscript run by WScipt.exe.
the problem is that the script will exit before any events are raised .. before the sub that handles the event. how can i keep the script open long enough to get the events?
i am calling the script from a command prompt: wscript.exe test.vbs
here is my code;
set obj = WScript.CreateObject("TestApp.Agent", "agent_")
MsgBox "Value from Init is " & obj.Init
MsgBox "Status: " + obj.StatusMesssage
MsgBox "New Session Id: " + obj.NewSessionId
MsgBox "Len: " + CStr(Len(obj.NewSessionId))
if Len(obj.NewSessionId) > 0 then
MsgBox "Event fired - val is " & val