Skip to content

Commit 0ad25ce

Browse files
authored
Merge pull request #5424 from Rageking8/fix-backtick-placement-in-adding-connection-points-to-an-object
Fix backtick placement in "Adding Connection Points to an Object"
2 parents 1b8415b + 49f1f62 commit 0ad25ce

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed
Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,55 @@
11
---
2-
description: "Learn more about: Adding Connection Points to an Object"
32
title: "Adding Connection Points to an Object"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Adding Connection Points to an Object"
4+
ms.date: 11/04/2016
55
helpviewer_keywords: ["connection points [C++], adding to ATL objects", "Implement Connection Point ATL wizard"]
6-
ms.assetid: 843531be-4a36-4db0-9d54-e029b1a72a8b
76
ms.topic: how-to
87
---
98
# Adding Connection Points to an Object
109

11-
The [ATL Tutorial](../atl/active-template-library-atl-tutorial.md) demonstrates how to create a control with support for connection points, how to add events, and then how to implement the connection point. ATL implements connection points with the [IConnectionPointImpl](../atl/reference/iconnectionpointimpl-class.md) class.
10+
The [ATL Tutorial](active-template-library-atl-tutorial.md) demonstrates how to create a control with support for connection points, how to add events, and then how to implement the connection point. ATL implements connection points with the [`IConnectionPointImpl`](reference/iconnectionpointimpl-class.md) class.
1211

1312
To implement a connection point, you have two choices:
1413

1514
- Implement your own outgoing event source, by adding a connection point to the control or object.
16-
1715
- Reuse a connection point interface defined in another type library.
1816

19-
In either case, the Implement Connection Point Wizard uses a type library to do its work.
17+
In either case, the **Implement Connection Point Wizard** uses a type library to do its work.
2018

21-
### To add a connection point to a control or object
19+
### Add a connection point to a control or object
2220

23-
1. Define a dispinterface in the library block of the .idl file. If you enabled support for connection points when you created the control with the ATL Control Wizard, the dispinterface will already be created. If you did not enable support for connection points when you created the control, you must manually add a dispinterface to the .idl file. The following is an example of a dispinterface. Outgoing interfaces are not required to be dispatch interfaces but many scripting languages such as VBScript and JScript require this, so this example uses two dispinterfaces:
21+
1. Define a dispinterface in the library block of the `.idl` file. If you enabled support for connection points when you created the control with the **ATL Control Wizard**, the dispinterface will already be created. If you did not enable support for connection points when you created the control, you must manually add a dispinterface to the `.idl` file. The following is an example of a dispinterface. Outgoing interfaces are not required to be dispatch interfaces but many scripting languages such as VBScript and JScript require this, so this example uses two dispinterfaces:
2422

25-
[!code-cpp[NVC_ATL_Windowing#81](../atl/codesnippet/cpp/adding-connection-points-to-an-object_1.idl)]
23+
[!code-cpp[NVC_ATL_Windowing#81](codesnippet/cpp/adding-connection-points-to-an-object_1.idl)]
2624

27-
Use either the uuidgen.exe or guidgen.exe utility to generate a GUID.
25+
Use either the `uuidgen.exe` or `guidgen.exe` utility to generate a GUID.
2826

29-
2. Add the dispinterface as the `[default,source]` interface in the coclass for the object in the project's .idl file. Again, if you enabled support for connection points when you created the control, the ATL Control Wizard will create the `[default,source`] entry. To manually add this entry, add the line in bold:
27+
2. Add the dispinterface as the `[default,source]` interface in the coclass for the object in the project's `.idl` file. Again, if you enabled support for connection points when you created the control, the ATL Control Wizard will create the `[default,source]` entry. To manually add this entry, add the line in bold:
3028

31-
[!code-cpp[NVC_ATL_Windowing#82](../atl/codesnippet/cpp/adding-connection-points-to-an-object_2.idl)]
29+
[!code-cpp[NVC_ATL_Windowing#82](codesnippet/cpp/adding-connection-points-to-an-object_2.idl)]
3230

33-
See the .idl file in the [Circ](../overview/visual-cpp-samples.md) ATL sample for an example.
31+
See the `.idl` file in the [Circ](../overview/visual-cpp-samples.md) ATL sample for an example.
3432

35-
3. Use Class View to add methods and properties to the event interface. Right-click the class in Class View, point to **Add** on the shortcut menu, and click **Add Connection Point**.
33+
3. Use **Class View** to add methods and properties to the event interface. Right-click the class in **Class View**, point to **Add** on the shortcut menu, and select **Add Connection Point**.
3634

37-
4. In the **Source Interfaces** list box of the Implement Connection Point Wizard, select **Project's interfaces**. If you choose an interface for your control and press **OK**, you will:
35+
4. In the **Source Interfaces** list box of the **Implement Connection Point Wizard**, select **Project's interfaces**. If you choose an interface for your control and select **OK**, you:
3836

3937
- Generate a header file with an event proxy class that implements the code that will make the outgoing calls for the event.
40-
4138
- Add an entry to the connection point map.
4239

43-
You will also see a list of all of the type libraries on your computer. You should only use one of these other type libraries to define your connection point if you want to implement the exact same outgoing interface found in another type library.
44-
45-
### To reuse a connection point interface defined in another type library
40+
You also see a list of all of the type libraries on your computer. Only use one of these other type libraries to define your connection point if you want to implement the exact same outgoing interface found in another type library.
4641

47-
1. In Class View, right-click a class that implements a **BEGIN_COM_MAP** macro, point to **Add** on the shortcut menu, and click **Add Connection Point**.
42+
### Reuse a connection point interface defined in another type library
4843

49-
2. In the Implement Connection Point Wizard, select a type library and an interface in the type library and click **Add**.
44+
1. In **Class View**, right-click a class that implements a `BEGIN_COM_MAP` macro, point at **Add** on the shortcut menu, and select **Add Connection Point**.
5045

51-
3. Edit the .idl file to either:
46+
2. In the **Implement Connection Point Wizard**, select a type library and an interface in the type library and select **Add**.
5247

53-
- Copy the dispinterface from the .idl file for the object whose event-source is being used.
48+
3. Edit the `.idl` file to either:
5449

50+
- Copy the dispinterface from the `.idl` file for the object whose event-source is being used.
5551
- Use the **importlib** instruction on that type library.
5652

5753
## See also
5854

59-
[Connection Point](../atl/atl-connection-points.md)
55+
[Connection Point](atl-connection-points.md)

0 commit comments

Comments
 (0)