Skip to content

Commit 19406b7

Browse files
author
mikeblome
committed
updates for Class Wizard
1 parent 6d78e03 commit 19406b7

24 files changed

+57
-133
lines changed

docs/mfc/activex-control-containers-handling-events-from-an-activex-control.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@ ms.assetid: f9c106db-052f-4e32-82ad-750646aa760b
66
---
77
# ActiveX Control Containers: Handling Events from an ActiveX Control
88

9-
This article discusses using the [Class Wizard](reference/mfc-class-wizard.md) to install event handlers for ActiveX controls in an ActiveX control container. The event handlers are used to receive notifications (from the control) of certain events and perform some action in response. This notification is called "firing" the event.
9+
This article discusses using the **Properties** window to install event handlers for ActiveX controls in an ActiveX control container. The event handlers are used to receive notifications (from the control) of certain events and perform some action in response. This notification is called "firing" the event.
1010

1111
>[!IMPORTANT]
1212
> ActiveX is a legacy technology that should not be used for new development. For more information about modern technologies that supersede ActiveX, see [ActiveX Controls](activex-controls.md).
1313
1414
> [!NOTE]
1515
> This article uses a dialog-based ActiveX control container project named Container and an embedded control named Circ as examples in the procedures and code.
1616
17-
Using the Events button in the [Class Wizard](reference/mfc-class-wizard.md), you can create a map of events that can occur in your ActiveX control container application. This map, called an "event sink map,'' is created and maintained by Visual C++ when you add event handlers to the control container class. Each event handler, implemented with an event map entry, maps a specific event to a container event handler member function. This event handler function is called when the specified event is fired by the ActiveX control object.
17+
Using the Events button in the **Properties** window, you can create a map of events that can occur in your ActiveX control container application. This map, called an "event sink map,'' is created and maintained by Visual C++ when you add event handlers to the control container class. Each event handler, implemented with an event map entry, maps a specific event to a container event handler member function. This event handler function is called when the specified event is fired by the ActiveX control object.
1818

1919
For more information on event sink maps, see [Event Sink Maps](../mfc/reference/event-sink-maps.md) in the *Class Library Reference*.
2020

2121
## <a name="_core_event_handler_modifications_to_the_project"></a> Event Handler Modifications to the Project
2222

23-
When you use the [Class Wizard](reference/mfc-class-wizard.md) to add event handlers, an event sink map is declared and defined in your project. The following statements are added to the control .CPP file the first time an event handler is added. This code declares an event sink map for the dialog box class (in this case, `CContainerDlg`):
23+
When you use the **Properties** window to add event handlers, an event sink map is declared and defined in your project. The following statements are added to the control .CPP file the first time an event handler is added. This code declares an event sink map for the dialog box class (in this case, `CContainerDlg`):
2424

2525
[!code-cpp[NVC_MFC_AxCont#8](../mfc/codesnippet/cpp/activex-control-containers-handling-events-from-an-activex-control_1.cpp)]
2626
[!code-cpp[NVC_MFC_AxCont#9](../mfc/codesnippet/cpp/activex-control-containers-handling-events-from-an-activex-control_2.cpp)]
2727

28-
As you use the [Class Wizard](reference/mfc-class-wizard.md) to add events, an event map entry (`ON_EVENT`) is added to the event sink map and an event handler function is added to the container's implementation (.CPP) file.
28+
As you use the **Properties** window to add events, an event map entry (`ON_EVENT`) is added to the event sink map and an event handler function is added to the container's implementation (.CPP) file.
2929

3030
The following example declares an event handler, called `OnClickInCircCtrl`, for the Circ control's `ClickIn` event:
3131

@@ -41,11 +41,11 @@ For more information on event sink macros, see [Event Sink Maps](../mfc/referenc
4141

4242
1. From Class View, select the dialog class that contains the ActiveX control. For this example, use `CContainerDlg`.
4343

44-
1. In the [Class Wizard](reference/mfc-class-wizard.md), click the **Events** button.
44+
1. In the **Properties** window, click the **Events** button.
4545

46-
1. In the [Class Wizard](reference/mfc-class-wizard.md), select the control ID of the embedded ActiveX control. For this example, use `IDC_CIRCCTRL1`.
46+
1. In the **Properties** window, select the control ID of the embedded ActiveX control. For this example, use `IDC_CIRCCTRL1`.
4747

48-
The [Class Wizard](reference/mfc-class-wizard.md) displays a list of events that can be fired by the embedded ActiveX control. Any member function shown in bold already has handler functions assigned to it.
48+
The **Properties** window displays a list of events that can be fired by the embedded ActiveX control. Any member function shown in bold already has handler functions assigned to it.
4949

5050
1. Select the event you want the dialog class to handle. For this example, select **Click**.
5151

docs/mfc/activex-control-containers-viewing-and-modifying-control-properties.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The first step in viewing the control's properties is to add an instance of the
2424

2525
1. Select the ActiveX control in the dialog box.
2626

27-
1. From the [Class Wizard](reference/mfc-class-wizard.md), click the **Properties** button.
27+
1. From the **Properties** window, click the **Properties** button.
2828

2929
Use the **Properties** dialog box to modify and test new properties immediately.
3030

docs/mfc/automation-servers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The framework's principal mechanism for supporting Automation is the dispatch ma
2525

2626
[!code-cpp[NVC_MFCAutomation#1](../mfc/codesnippet/cpp/automation-servers_1.cpp)]
2727

28-
The [Class Wizard](reference/mfc-class-wizard.md) and Class View assist in maintaining dispatch maps. When you add a new method or property to a class, Visual C++ adds a corresponding `DISP_FUNCTION` or `DISP_PROPERTY` macro with parameters indicating the class name, external and internal names of the method or property, and data types.
28+
The [Class Wizard](reference/mfc-class-wizard.md) and Class View assist in maintaining dispatch maps. When you add a new method or property to a class, Visual Studio adds a corresponding `DISP_FUNCTION` or `DISP_PROPERTY` macro with parameters indicating the class name, external and internal names of the method or property, and data types.
2929

3030
The **Add Class** dialog box also simplifies the declaration of Automation classes and the management of their properties and operations. When you use the Add Class dialog box to add a class to your project, you specify its base class. If the base class allows Automation, the Add Class dialog box displays controls you use to specify whether the new class should support Automation, whether it is "OLE creatable" (that is, whether objects of the class can be created on a request from a COM client), and the external name for the COM client to use.
3131

docs/mfc/example-displaying-a-dialog-box-via-a-menu-command.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Example: Displaying a Dialog Box via a Menu Command"
3-
ms.date: "11/04/2016"
3+
ms.date: "09/07/2019"
44
helpviewer_keywords: ["MFC dialog boxes [MFC], examples", "MFC dialog boxes [MFC], displaying", "modeless dialog boxes [MFC], displaying", "dialog boxes [MFC], MFC", "modal dialog boxes [MFC], displaying", "examples [MFC], dialog boxes", "menu items [MFC], examples"]
55
ms.assetid: e8692549-acd7-478f-9c5e-ba310ce8cccd
66
---
@@ -31,7 +31,7 @@ The procedures use the following names and values:
3131

3232
1. Add a class for your dialog box. See [Adding a Class](../ide/adding-a-class-visual-cpp.md) for more information.
3333

34-
1. In **Class View**, select the document class (CDisplayDialogDoc). In the **Properties** window, click the **Events** button. Double-click the ID of the menu command (ID_VIEW_TEST) in the left pane of the **Properties** window and select **Command**. In the right pane, click the down arrow and select **\<Add> OnViewTest**.
34+
1. In **Class View**, select the document class (CDisplayDialogDoc). In the [Class Wizard](reference/mfc-class-wizard.md), click the **Events** button. Double-click the ID of the menu command (ID_VIEW_TEST) in the left pane of the [Class Wizard](reference/mfc-class-wizard.md) and select **Command**. In the right pane, click the down arrow and select **\<Add> OnViewTest**.
3535

3636
If you added the menu command to the mainframe of an MDI application, select the application class (CDisplayDialogApp) instead.
3737

docs/mfc/how-to-customize-the-application-button.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "How to: Customize the Application Button"
3-
ms.date: "11/19/2018"
3+
ms.date: "09/07/2019"
44
helpviewer_keywords: ["application button [MFC], customizing"]
55
ms.assetid: ebb11180-ab20-43df-a234-801feca9eb38
66
---
@@ -10,7 +10,7 @@ When you click the Application button, a menu of commands is displayed. Typicall
1010

1111
![MFC Ribbon Application Button](../mfc/media/application_button.png "MFC Ribbon Application Button")
1212

13-
To customize the Application button, open it in the **Properties** window, modify its properties, and then preview the ribbon control.
13+
To customize the Application button, open it in the [Class Wizard](reference/mfc-class-wizard.md), modify its properties, and then preview the ribbon control.
1414

1515
### To open the Application button in the [Class Wizard](reference/mfc-class-wizard.md)
1616

docs/mfc/how-to-customize-the-quick-access-toolbar.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "How to: Customize the Quick Access Toolbar"
3-
ms.date: "11/19/2018"
3+
ms.date: "09/07/2019"
44
helpviewer_keywords: ["quick access toolbar [MFC], customization"]
55
ms.assetid: 2554099b-0c89-4605-9249-31bf9cbcefe0
66
---
@@ -10,7 +10,7 @@ The Quick Access Toolbar (QAT) is a customizable toolbar that contains a set of
1010

1111
![MFC Ribbon Quick Access Toolbar](../mfc/media/quick_access_toolbar.png "MFC Ribbon Quick Access Toolbar")
1212

13-
To customize the Quick Access Toolbar, open it in the **Properties** window, modify its commands, and then preview the ribbon control.
13+
To customize the Quick Access Toolbar, open it in the [Class Wizard](reference/mfc-class-wizard.md), modify its commands, and then preview the ribbon control.
1414

1515
### To open the Quick Access Toolbar in the [Class Wizard](reference/mfc-class-wizard.md)
1616

@@ -31,7 +31,7 @@ The following table defines the properties of the Quick Access Toolbar.
3131

3232
#### To add or remove commands on the Quick Access Toolbar
3333

34-
1. In the **Properties** window, click **QAT Items**, and then click the ellipsis button **(...)**.
34+
1. In the [Class Wizard](reference/mfc-class-wizard.md), click **QAT Items**, and then click the ellipsis button **(...)**.
3535

3636
1. In the **QAT Items Editor** dialog box, use the **Add** and **Remove** buttons to modify the list of commands on the Quick Access Toolbar.
3737

docs/mfc/mfc-activex-controls-adding-custom-events.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The following procedure adds a specific custom event, ClickIn. You can use this
1616

1717
1. Load your control's project.
1818

19-
1. In Class View, right-click your ActiveX control class to open the shortcut menu.
19+
1. In **Class View**, right-click your ActiveX control class to open the shortcut menu.
2020

2121
1. From the shortcut menu, click **Add** and then click **Add Event**.
2222

@@ -56,25 +56,25 @@ This line assigns the ClickIn event a specific ID number, taken from the event's
5656

5757
## <a name="_core_calling_fireclickin"></a> Calling FireClickIn
5858

59-
Now that you have added the ClickIn custom event using the Add Event Wizard, you must decide when this event is to be fired. You do this by calling `FireClickIn` when the appropriate action occurs. For this discussion, the control uses the `InCircle` function inside a WM_LBUTTONDOWN message handler to fire the ClickIn event when a user clicks inside a circular or elliptical region. The following procedure adds the WM_LBUTTONDOWN handler.
59+
Now that you have added the ClickIn custom event using the Add Event Wizard, you must decide when this event is to be fired. You do this by calling `FireClickIn` when the appropriate action occurs. For this discussion, the control uses the `InCircle` function inside a `WM_LBUTTONDOWN` message handler to fire the ClickIn event when a user clicks inside a circular or elliptical region. The following procedure adds the `WM_LBUTTONDOWN` handler.
6060

6161
#### To add a message handler with the Add Event Wizard
6262

6363
1. Load your control's project.
6464

65-
1. In Class View, select your ActiveX control class.
65+
1. In **Class View**, select your ActiveX control class.
6666

67-
1. In the [Class Wizard](reference/mfc-class-wizard.md), click the **Messages** button.
67+
1. In [Class Wizard](reference/mfc-class-wizard.md), click the **Messages** tab.
6868

6969
The [Class Wizard](reference/mfc-class-wizard.md) displays a list of messages that can be handled by the ActiveX control. Any message shown in bold already has a handler function assigned to it.
7070

71-
1. From the [Class Wizard](reference/mfc-class-wizard.md), select the message you want to handle. For this example, select WM_LBUTTONDOWN.
71+
1. From the [Class Wizard](reference/mfc-class-wizard.md), select the message you want to handle. For this example, select `WM_LBUTTONDOWN`.
7272

7373
1. From the drop-down list box on the right, select **\<Add> OnLButtonDown**.
7474

75-
1. Double-click the new handler function in Class View to jump to the message handler code in the implementation (.CPP) file of your ActiveX control.
75+
1. Double-click the new handler function in **Class View** to jump to the message handler code in the implementation (.CPP) file of your ActiveX control.
7676

77-
The following code sample calls the `InCircle` function every time the left mouse button is clicked within the control window. This sample can be found in the WM_LBUTTONDOWN handler function, `OnLButtonDown`, in the [Circ sample](../overview/visual-cpp-samples.md) abstract.
77+
The following code sample calls the `InCircle` function every time the left mouse button is clicked within the control window. This sample can be found in the `WM_LBUTTONDOWN` handler function, `OnLButtonDown`, in the [Circ sample](../overview/visual-cpp-samples.md) abstract.
7878

7979
[!code-cpp[NVC_MFC_AxUI#10](../mfc/codesnippet/cpp/mfc-activex-controls-adding-custom-events_4.cpp)]
8080

@@ -99,7 +99,7 @@ The following procedure adds a custom Click event.
9999

100100
1. Load your control's project.
101101

102-
1. In Class View, right-click your ActiveX control class to open the shortcut menu.
102+
1. In **Class View**, right-click your ActiveX control class to open the shortcut menu.
103103

104104
1. From the shortcut menu, click **Add** and then click **Add Event**.
105105

docs/mfc/reference/adding-an-mfc-message-handler.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ ms.assetid: 4251cfce-76ca-443d-bd2f-6303afa6d942
77
---
88
# Adding an MFC Message Handler
99

10-
You can use the [Class Wizard](reference/mfc-class-wizard.md)to add a message handler (a member function that handles Windows messages) to a class and map Windows messages to the message handler. You can also add [an event handler for any dialog box control](../../windows/adding-event-handlers-for-dialog-box-controls.md).
10+
You can use the [Class Wizard](reference/mfc-class-wizard.md) or the **Properties** window in **CLass View** to add a message handler (a member function that handles Windows messages) to a class and map Windows messages to the message handler. You can also add [an event handler for any dialog box control](../../windows/adding-event-handlers-for-dialog-box-controls.md).
1111

12-
By using the Class Wizard to define message- and event-handling functions, you can automatically update the message-dispatch table (or message map) and your class header file.
12+
By using the Class Wizard or Properties window to define message- and event-handling functions, you can automatically update the message-dispatch table (or message map) and your class header file.
1313

1414
> [!NOTE]
1515
> You can add a message handler to an ATL class using the Class Wizard; however, some results may vary. For more information, see the ATL topic [Adding an ATL Message Handler](../../atl/adding-an-atl-message-handler.md).

docs/mfc/reference/ccmdui-class.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class CCmdUI
4141

4242
`CCmdUI` does not have a base class.
4343

44-
When a user of your application pulls down a menu, each menu item needs to know whether it should be displayed as enabled or disabled. The target of a menu command provides this information by implementing an ON_UPDATE_COMMAND_UI handler. For each of the command user-interface objects in your application, use the [Class Wizard](mfc-class-wizard.md) to create a message-map entry and function prototype for each handler.
44+
When a user of your application pulls down a menu, each menu item needs to know whether it should be displayed as enabled or disabled. The target of a menu command provides this information by implementing an ON_UPDATE_COMMAND_UI handler. For each of the command user-interface objects in your application, use the [Class Wizard](mfc-class-wizard.md) or Properties window in Class View to create a message-map entry and function prototype for each handler.
4545

4646
When the menu is pulled down, the framework searches for and calls each ON_UPDATE_COMMAND_UI handler, each handler calls `CCmdUI` member functions such as `Enable` and `Check`, and the framework then appropriately displays each menu item.
4747

docs/mfc/reference/creating-a-forms-based-mfc-application.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Creating a Forms-Based MFC Application"
3-
ms.date: "08/19/2019"
3+
ms.date: "09/09/2019"
44
f1_keywords: ["vc.appwiz.mfcforms.project"]
55
helpviewer_keywords: ["applications [MFC], forms-based", "forms-based applications [MFC]"]
66
ms.assetid: 048d2f7d-b60d-4386-ad8e-71d49af9c05e
@@ -21,7 +21,7 @@ Any dialog-based application, by definition, is forms based. A dialog-based appl
2121

2222
The base class for form-based applications is [CFormView](cformview-class.md). If your application has database support, then you can also select any class that derives from `CFormView`. A form is any window derived from `CFormView` or from any class that inherits from `CFormView`.
2323

24-
Even if you use a base class such as [CView](cview-class.md), you can later make your applications forms-based by [adding an MFC class](adding-an-mfc-class.md) derived from `CFormView` and checking the **Generate DocTemplate resources** checkbox in the [MFC Class Wizard](document-template-strings-mfc-add-class-wizard.md).
24+
Even if you use a base class such as [CView](cview-class.md), you can later make your applications forms-based by [adding an MFC class](adding-an-mfc-class.md) derived from `CFormView`.
2525

2626
Once you finish with the wizard, your project opens, and if you selected `CFormView` (or a class that inherits from `CFormView`) as your base class or if you created a dialog-based application, Visual C++ opens the dialog editor. At this point, you are ready to design your first form.
2727

0 commit comments

Comments
 (0)