class CGXPluginComponent: public CWnd
CGXPluginComponent is the base class for "Plug-in components". Plug-in components are CWnd-derived classes that can share a window handle with another CWnd and process window messages for that window. This allows you to implement reusable window functionality that can be attached to various window classes. There is no need to inherit from an existing window class only to add a specific functionality.
A real world example for using this plug-in approach is the convenient and reusable CGXIntelliMousePlugin component that can be attached to any CWnd or CView class. The component provides support for intelli-mouse scrolling, zooming and panning. No code change is necessary in the component source code to use its functionality with different window and view classes.
The major steps for implementing and adding a plug-in component are:
-
Derive a class from CGXPluginComponent where you add the functionality that should be encapsulated in the plug-in component.
- In your window or view class, override WindowProc and then call the OnWndMsg method of the plug-in component. At initialization time of the view or window (for example in OnInitialUpdate) call CGXPluginComponent::PlugIn(pParentWnd).
With CGXGridCore using a plug-in component is even easier. CGXGridCore already provides internally the necessary dispatching of messages in the WindowProc method. All you need to do is call AddPlugin() at initialization time of the grid to register the plug-in component.
See the section "Plug-in Components" for more information and a tutorial how to implement and use plug-in components in your application.
#include <gxall.h>
See Also
CGXIntelliMousePlugin CGXGridCore::AddPlugin