MvcController::SetActiveController
voidMvcController::SetActiveController(MvcController*pCtlr)
Sets the active controller to the specified controller
Defined in: MvcController.cpp
Return Value
void
Parameters
pCtlr
The controller to make the active controller
Comments
There can be zero or one active controllers in the system at any point in time. When a new message arrives, the window searches for a controller that wants to handle the incoming message. When a controller is found, the message is routed to that controller. In its handling for the message, the controller may decide it wants to become the active controller. To make the controller active, you only need to call SetActiveController. In essense, the controller captures control, meaning it will receive all incoming messages until it decides it no longer needs to be the active controller. Even if you move the mouse outside of the containing window, the active controller will still be routed all incoming messages. (NOTE: In addition to maintaining the active controller global variable, SetActiveController also calls CWnd::SetCapture() by default). At this point, it can call SetActiveController again passing NULL. Passing NULL to SetActiveController causes no controller to be active (NOTE: this results in an implicit call to ReleaseCapture()). Therefore, the next new message will result in a search for a new controller to handle the message.See Also