XLL+ Class Library (6.3)

CXlSelectionChangeEventStaticObserver::Update

Respond to an event

virtual void Update(
   CXlRangeEventArgs* e
);

Parameters

e

A pointer to an event arguments object is sent to the Update method.

Remarks

Derived classes should implement this function, which is the event handler for the XLL+ event model.

Example

The code below defines a class derived from CXlSelectionChangeEventStaticObserver, implements an Update method which is called when the event occurs, and instantiates an instance of the new class.

CopyC++
// Define a class derived from CXlSelectionChangeEventStaticObserver 
class CMySelectionChangeEventObserver : CXlSelectionChangeEventStaticObserver
{
public:
    // This method will be called during the XlSelectionChange event. 
    virtual void Update(CXlRangeEventArgs* e)
    {
        CXllApp::XlMessageBox(_T("Selection changed to ") + e->GetRange(), 
            XlMessageBoxTypeInformation);
    }
};

// Create an instance of the class
CMySelectionChangeEventObserver mySelectionChangeObserver;

Requirements

Header: xlpevents.h

See Also

CXlSelectionChangeEventStaticObserver Class | CXlSelectionChangeEventStaticObserver Methods