How to associate the COM event source method to the sink in Powershell?
We have a COM component with an event source method. Once some special events happen during the execution, it will send some information back to the caller( event_sink/callback function).
Suppose the COM component name is "Taskhandler" and the event source method name is "OnStatusupdate". For example, in VBScript, we can simply give the sub-procedure name as "Taskhandler_OnStatusupdate(...)", then once events are fired, that procedure will be called automatically.
Now, we want to do the same thing in the Powershell script - once events are fired, a special function in the caller will be called. Unfortunately, we don't know how to associate the event source with the callback function. Does anyone know how to solve this problem?
谢谢
We have a COM component with an event source method. Once some special events happen during the execution, it will send some information back to the caller( event_sink/callback function).
Suppose the COM component name is "Taskhandler" and the event source method name is "OnStatusupdate". For example, in VBScript, we can simply give the sub-procedure name as "Taskhandler_OnStatusupdate(...)", then once events are fired, that procedure will be called automatically.
Now, we want to do the same thing in the Powershell script - once events are fired, a special function in the caller will be called. Unfortunately, we don't know how to associate the event source with the callback function. Does anyone know how to solve this problem?
谢谢