Respond to an event
virtual void Update( CXlWorksheetEventArgs* e ); |
A pointer to an event arguments object is sent to the Update method.
Derived classes should implement this function, which is the event handler for the XLL+ event model.
The code below defines a class derived from CXlCalculateEventStaticObserver, implements an Update method which is called when the event occurs, and instantiates an instance of the new class.
// Define a class derived from CXlCalculateEventStaticObserver class CMyCalculateEventObserver : CXlCalculateEventStaticObserver { public: // This method will be called during the XlCalculate event. virtual void Update(CXlWorksheetEventArgs* e) { CXllApp::XlMessageBox(_T("Calculating ") + e->GetSheetName(), XlMessageBoxTypeInformation); } }; // Create an instance of the class CMyCalculateEventObserver myCalculateObserver;
Header: xlpevents.h
CXlCalculateEventStaticObserver Class | CXlCalculateEventStaticObserver Methods