XLL+ Class Library (6.3)

CXlBeforeDoubleClickEventStaticObserver::Update

Respond to an event

virtual void Update(
   CXlCancellableRangeEventArgs* 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 CXlBeforeDoubleClickEventStaticObserver, implements an Update method which is called when the event occurs, and instantiates an instance of the new class.

Note that this particular Update method uses CXlCancellableRangeEventArgs::SetCancel to cancel the double-click event. As a result, Excel does not switch to edit mode.

CopyC++
// Define a class derived from CXlBeforeDoubleClickEventStaticObserver 
class CMyBeforeDoubleClickEventObserver : CXlBeforeDoubleClickEventStaticObserver
{
public:
    // This method will be called during the XlBeforeDoubleClick event. 
    virtual void Update(CXlCancellableRangeEventArgs* e)
    {
        CXllApp::XlMessageBox(_T("Double-click at ") + e->GetRange(), 
            XlMessageBoxTypeInformation);
        e->SetCancel(true);
    }
};

// Create an instance of the class
CMyBeforeDoubleClickEventObserver myDoubleClickObserver;

Requirements

Header: xlpevents.h

See Also

CXlBeforeDoubleClickEventStaticObserver Class | CXlBeforeDoubleClickEventStaticObserver Methods