RAISEEVENT statement


Call Event Handler code.


RAISEEVENT ObjVar.Method()


The RAISEEVENT statement is used to call event handler code from an Event Source.  RAISEEVENT may only appear within a class which declares the Event Source interface.  The concept of RAISEEVENT is very similar to the CALL statement, but it may only be used to execute event procedures:

RaiseEvent Status.Progress(10) ' advise the code is 10% done

It should be noted that RAISEEVENT does not reference an object variable at all, because it calls any and all Direct, V-Table event handlers which are currently subscribed to these events.  Instead, it references the interface name (in this case "Status"), followed by the name of the Event Method to be executed (in this case "Progress"). If your program is using a Dispatch event handler you should use the OBJECT RAISEEVENT statement instead.

See also

CLASS, EVENT SOURCE. EVENTS, INTERFACE (Direct), INTERFACE (IDBind), Just what is COM?, EVENTS, OBJECT RAISEEVENT, What is an object, anyway?, What are Connection Points?


See the EVENT SOURCE statement for an example of RAISEEVENT.