XLL+ Class Library (6.3)

CXllOpenEventStaticObserver::Update

Respond to an event

virtual void Update(
   CXllOpenEventArgs* 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 CXllOpenEventStaticObserver, 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 CXllOpenEventArgs::SetCancel to cancel the open event for the XLL.

CopyC++
// Define a class derived from CXllOpenEventStaticObserver 
class CMyOpenEventObserver : CXllOpenEventStaticObserver
{
public:
    // This method will be called during the XllOpen event. 
    virtual void Update(CXllOpenEventArgs* e)
    {
        CXllApp::XlMessageBox(
            _T("The event observer will now cancel the XllOpen event"), 
            XlMessageBoxTypeInformation);
        e->SetCancel(true);
    }
};

// Create an instance of the class
CMyOpenEventObserver myOpenObserver;

Requirements

Header: xlpevents.h

See Also

CXllOpenEventStaticObserver Class | CXllOpenEventStaticObserver Methods