Template class for managing an ActiveX control site. More...
#include <SAxContainer.h>
Public Member Functions | |
| ActiveXSite () | |
| Constructor for ActiveXSite. | |
| virtual | ~ActiveXSite () |
| Destructor for ActiveXSite. | |
| void | SetAxHost (IAxHostDelegate *pAxHost) |
| Set the delegate for ActiveX host operations. | |
| void | SetExternalUIHandler (IDocHostUIHandler *pUiHandler) |
| Set the external UI handler for the ActiveX control. | |
| IUnknown * | GetActiveXControl () |
| Get the ActiveX control. | |
| void | Init (IUnknown *pControl) |
| Initialize the ActiveX control. | |
| void | Clear () |
| Clear the ActiveX control and release resources. | |
| HRESULT | InitControl (IStream *pStream=NULL) |
| Initialize the ActiveX control from a stream. | |
| HRESULT | ActivateAx (IStream *pStream=NULL) |
| Activate the ActiveX control. | |
| bool | HitTest (const POINT &pt) const |
| Check if a point is within the ActiveX control. | |
| bool | InsideClippingRegion (const RECT &rcClip) const |
| Check if the control intersects with a clipping region. | |
| HRESULT | DoVerb (long verb) |
| Perform a verb on the ActiveX control. | |
| LRESULT | Draw (HDC hDC, LPCRECT lpClipRect) |
| Draw the ActiveX control. | |
| HRESULT | FireAmbientPropertyChange (DISPID dispChanged) |
| Fire an ambient property change notification. | |
| LRESULT | OnWindowMessage (UINT uMsg, WPARAM wParam, LPARAM lParam) |
| Handle a window message for the ActiveX control. | |
| STDMETHOD | QueryInterface2 (REFIID iid, void **object) |
| Query for an interface. | |
| STDMETHOD | SaveObject (void) |
| Save the object. | |
| STDMETHOD | GetMoniker (DWORD, DWORD dwWhichMoniker, IMoniker **ppmk) |
| Get the moniker for the object. | |
| STDMETHOD | GetContainer (IOleContainer **ppContainer) |
| Get the container for the object. | |
| STDMETHOD | ShowObject (void) |
| Show the object. | |
| STDMETHOD | OnShowWindow (BOOL fShow) |
| Notify the container of a show window event. | |
| STDMETHOD | RequestNewObjectLayout (void) |
| Request a new object layout. | |
| STDMETHOD | OnControlInfoChanged (void) |
| Notify the control that its info has changed. | |
| STDMETHOD | LockInPlaceActive (BOOL) |
| Lock the control in place active state. | |
| STDMETHOD | GetExtendedControl (IDispatch **) |
| Get the extended control. | |
| STDMETHOD | TransformCoords (POINTL *, POINTF *, DWORD) |
| Transform coordinates between container and control. | |
| STDMETHOD | TranslateAccelerator (MSG *, DWORD) |
| Translate an accelerator key. | |
| STDMETHOD | OnFocus (BOOL fGotFocus) |
| Notify the control of focus change. | |
| STDMETHOD | ShowPropertyFrame (void) |
| Show the property frame for the control. | |
| STDMETHOD | CanWindowlessActivate (void) |
| Check if the control supports windowless activation. | |
| STDMETHOD | GetCapture (void) |
| Check if the control currently has the mouse capture. | |
| STDMETHOD | SetCapture (BOOL fCapture) |
| Set or release the mouse capture for the control. | |
| STDMETHOD | GetFocus (void) |
| Check if the control currently has focus. | |
| STDMETHOD | SetFocus (BOOL fFocus) |
| Set or release focus for the control. | |
| STDMETHOD | GetDC (LPCRECT pRect, DWORD grfFlags, HDC *phDC) |
| Get a device context for the control. | |
| STDMETHOD | ReleaseDC (HDC hDC) |
| Release a previously obtained device context. | |
| STDMETHOD | InvalidateRect (LPCRECT pRect, BOOL fErase) |
| Invalidate a rectangle of the control. | |
| STDMETHOD | InvalidateRgn (HRGN, BOOL fErase) |
| Invalidate a region of the control. | |
| STDMETHOD | ScrollRect (INT, INT, LPCRECT, LPCRECT) |
| Scroll a rectangle of the control. | |
| STDMETHOD | AdjustRect (LPRECT) |
| Adjust a rectangle for the control. | |
| STDMETHOD | OnDefWindowMessage (UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) |
| Handle a default window message for the control. | |
| STDMETHOD | OnInPlaceActivateEx (BOOL *pfNoRedraw, DWORD dwFlags) |
| Activate the control in-place with extended options. | |
| STDMETHOD | OnInPlaceDeactivateEx (BOOL) |
| Deactivate the control in-place with extended options. | |
| STDMETHOD | RequestUIActivate (void) |
| Request UI activation for the control. | |
| STDMETHOD | CanInPlaceActivate (void) |
| Check if the control can be activated in-place. | |
| STDMETHOD | OnInPlaceActivate (void) |
| Activate the control in-place. | |
| STDMETHOD | OnUIActivate (void) |
| Activate the control's user interface. | |
| STDMETHOD | GetWindowContext (IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo) |
| Get the window context for the control. | |
| STDMETHOD | Scroll (SIZE) |
| Scroll the control. | |
| STDMETHOD | OnUIDeactivate (BOOL) |
| Deactivate the control's user interface. | |
| STDMETHOD | OnInPlaceDeactivate (void) |
| Deactivate the control in-place. | |
| STDMETHOD | DiscardUndoState (void) |
| Discard the undo state of the control. | |
| STDMETHOD | DeactivateAndUndo (void) |
| Deactivate and undo the control. | |
| STDMETHOD | OnPosRectChange (LPCRECT lprcPosRect) |
| Handle a change in the position rectangle of the control. | |
| STDMETHOD | GetWindow (HWND *phwnd) |
| Get the window handle for the control. | |
| STDMETHOD | ContextSensitiveHelp (BOOL) |
| Handle context-sensitive help for the control. | |
| void | OnDataChange (FORMATETC *, STGMEDIUM *) |
| Handle a change in data. | |
| void | OnViewChange (DWORD, LONG) |
| Handle a change in view. | |
| void | OnRename (IMoniker *) |
| Handle a rename of the object. | |
| void | OnSave (void) |
| Handle a save operation. | |
| void | OnClose (void) |
| Handle a close operation. | |
Protected Member Functions | |
| HRESULT | SetExtent (int width, int height) |
| Set the extent (size) of the control. | |
| HRESULT | DoInplaceActivate () |
| Perform in-place activation of the control. | |
Template class for managing an ActiveX control site.
This class implements the necessary interfaces to host and manage an ActiveX control within a container. It handles the lifecycle of the control and provides the required interface implementations.
| T | The derived class that will use this template. |
Definition at line 79 of file SAxContainer.h.
|
inline |
Constructor for ActiveXSite.
Definition at line 90 of file SAxContainer.h.
|
inlinevirtual |
Destructor for ActiveXSite.
Definition at line 107 of file SAxContainer.h.
|
inline |
Activate the ActiveX control.
| pStream | Pointer to the stream containing the control data. |
Definition at line 214 of file SAxContainer.h.
|
inline |
Adjust a rectangle for the control.
| prc | Rectangle to be adjusted. |
Definition at line 659 of file SAxContainer.h.
|
inline |
Check if the control can be activated in-place.
Definition at line 733 of file SAxContainer.h.
|
inline |
Check if the control supports windowless activation.
Definition at line 537 of file SAxContainer.h.
|
inline |
Clear the ActiveX control and release resources.
Definition at line 153 of file SAxContainer.h.
|
inline |
Handle context-sensitive help for the control.
| fEnterMode | Boolean indicating if help should be entered. |
Definition at line 880 of file SAxContainer.h.
|
inline |
Deactivate and undo the control.
Definition at line 834 of file SAxContainer.h.
|
inline |
Discard the undo state of the control.
Definition at line 825 of file SAxContainer.h.
|
inlineprotected |
Perform in-place activation of the control.
Definition at line 954 of file SAxContainer.h.
|
inline |
Perform a verb on the ActiveX control.
| verb | Verb to perform. |
Definition at line 278 of file SAxContainer.h.
|
inline |
Draw the ActiveX control.
| hDC | Device context to draw on. |
| lpClipRect | Clipping rectangle. |
Definition at line 305 of file SAxContainer.h.
|
inline |
Fire an ambient property change notification.
| dispChanged | DISPID of the changed property. |
Definition at line 324 of file SAxContainer.h.
|
inline |
Get the ActiveX control.
Definition at line 134 of file SAxContainer.h.
|
inline |
Check if the control currently has the mouse capture.
Definition at line 547 of file SAxContainer.h.
|
inline |
Get the container for the object.
| ppContainer | Pointer to receive the container. |
Definition at line 413 of file SAxContainer.h.
|
inline |
Get a device context for the control.
| pRect | Rectangle for which the DC is needed. |
| grfFlags | Flags specifying the type of DC. |
| phDC | Pointer to receive the device context. |
Definition at line 600 of file SAxContainer.h.
|
inline |
Get the extended control.
| ppDisp | Pointer to receive the extended control. |
Definition at line 486 of file SAxContainer.h.
|
inline |
Check if the control currently has focus.
Definition at line 572 of file SAxContainer.h.
|
inline |
Get the moniker for the object.
| dwAssign | Assignment type. |
| dwWhichMoniker | Type of moniker. |
| ppmk | Pointer to receive the moniker. |
Definition at line 403 of file SAxContainer.h.
|
inline |
Get the window handle for the control.
| phwnd | Pointer to receive the window handle. |
Definition at line 869 of file SAxContainer.h.
|
inline |
Get the window context for the control.
| ppFrame | Pointer to receive the in-place frame. |
| ppDoc | Pointer to receive the in-place document. |
| lprcPosRect | Pointer to receive the position rectangle. |
| lprcClipRect | Pointer to receive the clipping rectangle. |
| lpFrameInfo | Pointer to receive the frame information. |
Definition at line 765 of file SAxContainer.h.
|
inline |
Check if a point is within the ActiveX control.
| pt | Point to check. |
Definition at line 248 of file SAxContainer.h.
|
inline |
Initialize the ActiveX control.
| pControl | Pointer to the ActiveX control. |
Definition at line 143 of file SAxContainer.h.
|
inline |
Initialize the ActiveX control from a stream.
| pStream | Pointer to the stream containing the control data. |
Definition at line 188 of file SAxContainer.h.
|
inline |
Check if the control intersects with a clipping region.
| rcClip | Clipping region to check. |
Definition at line 264 of file SAxContainer.h.
|
inline |
Invalidate a rectangle of the control.
| pRect | Rectangle to be invalidated. |
| fErase | Boolean indicating if the background should be erased. |
Definition at line 621 of file SAxContainer.h.
|
inline |
Invalidate a region of the control.
| hRGN | Region to be invalidated. |
| fErase | Boolean indicating if the background should be erased. |
Definition at line 636 of file SAxContainer.h.
|
inline |
Lock the control in place active state.
| fLock | Boolean indicating if the lock should be set. |
Definition at line 476 of file SAxContainer.h.
|
inline |
Handle a close operation.
Definition at line 922 of file SAxContainer.h.
|
inline |
Notify the control that its info has changed.
Definition at line 466 of file SAxContainer.h.
|
inline |
Handle a change in data.
| pFormatetc | Format of the data. |
| pStgmed | Storage medium containing the data. |
Definition at line 891 of file SAxContainer.h.
|
inline |
Handle a default window message for the control.
| msg | Message identifier. |
| wParam | WPARAM for the message. |
| lParam | LPARAM for the message. |
| plResult | Pointer to receive the result of the message processing. |
Definition at line 672 of file SAxContainer.h.
|
inline |
Notify the control of focus change.
| fGotFocus | Boolean indicating if the control got focus. |
Definition at line 519 of file SAxContainer.h.
|
inline |
Activate the control in-place.
Definition at line 742 of file SAxContainer.h.
|
inline |
Activate the control in-place with extended options.
| pfNoRedraw | Pointer to a boolean indicating if redrawing should be suppressed. |
| dwFlags | Flags specifying activation options. |
Definition at line 685 of file SAxContainer.h.
|
inline |
Deactivate the control in-place.
Definition at line 816 of file SAxContainer.h.
|
inline |
Deactivate the control in-place with extended options.
| fNoRedraw | Boolean indicating if redrawing should be suppressed. |
Definition at line 713 of file SAxContainer.h.
|
inline |
Handle a change in the position rectangle of the control.
| lprcPosRect | New position rectangle. |
Definition at line 844 of file SAxContainer.h.
|
inline |
Handle a rename of the object.
| pmk | Moniker of the object. |
Definition at line 908 of file SAxContainer.h.
|
inline |
Handle a save operation.
Definition at line 915 of file SAxContainer.h.
|
inline |
Notify the container of a show window event.
| fShow | Boolean indicating if the window is being shown. |
Definition at line 447 of file SAxContainer.h.
|
inline |
Activate the control's user interface.
Definition at line 751 of file SAxContainer.h.
|
inline |
Deactivate the control's user interface.
| fUndoable | Boolean indicating if the deactivation can be undone. |
Definition at line 807 of file SAxContainer.h.
|
inline |
Handle a change in view.
| dwAspect | Aspect of the view. |
| lindex | Index of the view. |
Definition at line 900 of file SAxContainer.h.
|
inline |
Handle a window message for the ActiveX control.
| uMsg | Message identifier. |
| wParam | WPARAM for the message. |
| lParam | LPARAM for the message. |
Definition at line 340 of file SAxContainer.h.
|
inline |
Query for an interface.
| iid | IID of the interface to query. |
| object | Pointer to receive the interface. |
Definition at line 356 of file SAxContainer.h.
|
inline |
Release a previously obtained device context.
| hDC | Device context to be released. |
Definition at line 610 of file SAxContainer.h.
|
inline |
Request a new object layout.
Definition at line 457 of file SAxContainer.h.
|
inline |
Request UI activation for the control.
Definition at line 723 of file SAxContainer.h.
|
inline |
Save the object.
Definition at line 391 of file SAxContainer.h.
|
inline |
Scroll the control.
| scrollExtant | Size of the scroll. |
Definition at line 797 of file SAxContainer.h.
|
inline |
Scroll a rectangle of the control.
| dx | Horizontal scroll amount. |
| dy | Vertical scroll amount. |
| pRectScroll | Rectangle to be scrolled. |
| pRectClip | Clipping rectangle. |
Definition at line 649 of file SAxContainer.h.
|
inline |
Set the delegate for ActiveX host operations.
| pAxHost | Pointer to the delegate. |
Definition at line 116 of file SAxContainer.h.
|
inline |
Set or release the mouse capture for the control.
| fCapture | Boolean indicating if the capture should be set. |
Definition at line 558 of file SAxContainer.h.
|
inlineprotected |
Set the extent (size) of the control.
| width | Width of the control in pixels. |
| height | Height of the control in pixels. |
Definition at line 933 of file SAxContainer.h.
|
inline |
Set the external UI handler for the ActiveX control.
| pUiHandler | Pointer to the UI handler. |
Definition at line 125 of file SAxContainer.h.
|
inline |
Set or release focus for the control.
| fFocus | Boolean indicating if the focus should be set. |
Definition at line 582 of file SAxContainer.h.
|
inline |
Show the object.
Definition at line 426 of file SAxContainer.h.
|
inline |
Show the property frame for the control.
Definition at line 529 of file SAxContainer.h.
|
inline |
Transform coordinates between container and control.
| pPtlHimetric | Source coordinates in HIMETRIC. |
| pPtfContainer | Destination coordinates in container. |
| dwFlags | Flags specifying the transformation. |
Definition at line 498 of file SAxContainer.h.
|
inline |
Translate an accelerator key.
| pMsg | Message structure. |
| grfModifiers | Modifiers for the key. |
Definition at line 509 of file SAxContainer.h.