Shows how to set up event handlers for COM events
The code in this add-in demonstrates how to catch COM events using CXllApp::SetComEventHandler(). This technique is now deprecated and the unified event model should be used instead. See the following samples for examples of using the event model.
This project demonstrates how to use the CXllApp class to add event handler functions for COM Application events such as WorkbookOpen and SheetChange.
The sample displays the following features:
The following steps were significant in creating and completing the application.
CXllApp | CXllApp::SetSinkEvents | CXllApp::SetComEventHandler | CXllApp::OnXllOpen | CXllApp::OnXllClose
Each sample project is located in a sub-directory of the Samples directory of the XLL+ installation. To use the sample project, open the solution file ComEvents.sln or the project file ComEvents.vcproj.
You can enable debugging under Excel by using the Setup Debugging command in the XLL+ ToolWindow.
When delivered, the help files are excluded from the build.
You can enable the help build by selecting the files
ComEvents.help.xml
and
ComEvents.chm
in the Solution Explorer,
and using the right-click menu to view Properties.
Select the page "Configuration Properties/General" and
set the "Excluded from build" property to "No".
See Generating help
in the User Guide for more information.