Skip to content

Commit bdd563c

Browse files
Learn Build Service GitHub AppLearn Build Service GitHub App
authored andcommitted
Merging changes synced from https://github.com/MicrosoftDocs/cpp-docs-pr (branch live)
2 parents 0ebac9b + 12d0104 commit bdd563c

File tree

3 files changed

+373
-7
lines changed

3 files changed

+373
-7
lines changed

docs/mfc/reference/connection-maps.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ ms.date: "11/04/2016"
55
helpviewer_keywords: ["connection maps"]
66
ms.assetid: 1f25a9bc-6d09-4614-99cf-dc38e8ddfa73
77
---
8+
89
# Connection Maps
910

1011
OLE controls are able to expose interfaces to other applications. These interfaces only allow access from a container into that control. If an OLE control wants to access external interfaces of other OLE objects, a connection point must be established. This connection point allows a control outgoing access to external dispatch maps, such as event maps or notification functions.
1112

1213
The Microsoft Foundation Class Library offers a programming model that supports connection points. In this model, "connection maps" are used to designate interfaces or connection points for the OLE control. Connection maps contain one macro for each connection point. For more information on connection maps, see the [CConnectionPoint](../../mfc/reference/cconnectionpoint-class.md) class.
1314

14-
Typically, a control will support just two connection points: one for events and one for property notifications. These are implemented by the `COleControl` base class and require no additional work by the control writer. Any additional connection points you want to implement in your class must be added manually. To support connection maps and points, MFC provides the following macros:
15+
Typically, a control supports just two connection points: one for events and one for property notifications. These are implemented by the `COleControl` base class and require no extra work by the control writer. Any other connection points you want to implement in your class must be added manually. To support connection maps and points, MFC provides the following macros:
1516

1617
### Connection Map Declaration and Demarcation
1718

@@ -52,7 +53,7 @@ Specifies the name of the local class that implements the connection point.
5253

5354
### Remarks
5455

55-
In the declaration (.h) file that defines the member functions for your class, start the connection point with the BEGIN_CONNECTION_PART macro, then add the CONNECTION_IID macro and any other member functions you wish to implement, and complete the connection point map with the END_CONNECTION_PART macro.
56+
In the declaration (.h) file that defines the member functions for your class, start the connection point with the BEGIN_CONNECTION_PART macro. Then add the CONNECTION_IID macro and any other member functions you wish to implement. Finally, complete the connection point map with the END_CONNECTION_PART macro.
5657

5758
### Requirements
5859

@@ -90,7 +91,7 @@ The interface ID of the interface called by the connection point.
9091

9192
### Remarks
9293

93-
The *iid* argument is an interface ID used to identify the interface that the connection point will call on its connected sinks. For example:
94+
The *iid* argument is an interface ID used to identify the interface that the connection point calls on its connected sinks. For example:
9495

9596
[!code-cpp[NVC_MFCConnectionPoints#10](../../mfc/codesnippet/cpp/connection-maps_1.h)]
9697

@@ -177,7 +178,7 @@ For example:
177178

178179
[!code-cpp[NVC_MFCConnectionPoints#2](../../mfc/codesnippet/cpp/connection-maps_2.cpp)]
179180

180-
implements a connection map, with a connection point, that calls the `IID_ISinkInterface` interface .
181+
implements a connection map, with a connection point, that calls the `IID_ISinkInterface` interface.
181182

182183
### Requirements
183184

@@ -208,9 +209,13 @@ A pointer to the object that implements the interface.
208209
The interface ID of the connection.
209210

210211
*bRefCount*<br/>
211-
TRUE indicates that creating the connection should cause the reference count of *pUnkSink* to be incremented. FALSE indicates that the reference count should not be incremented.
212+
For out-of-process connections, this parameter must be TRUE, and indicates that creating the connection should cause the reference count of *pUnkSink* to be incremented.
213+
214+
For in-process connections, TRUE indicates that creating the connection should cause the reference count of *pUnkSink* to be incremented. FALSE indicates that the reference count should not be incremented.
215+
216+
**Warning**: In general, it can't be predicted which connections are in-process and which connections are out-of-process, so it is recommended to always set this parameter to TRUE.
212217

213-
*pdwCookie*<br/>
218+
*pdwCookie.*<br/>
214219
A pointer to a DWORD where a connection identifier is returned. This value should be passed as the *dwCookie* parameter to `AfxConnectionUnadvise` when disconnecting the connection.
215220

216221
### Return Value
@@ -250,7 +255,11 @@ A pointer to the object that implements the interface.
250255
The interface ID of the connection point interface.
251256

252257
*bRefCount*<br/>
253-
TRUE indicates that disconnecting the connection should cause the reference count of *pUnkSink* to be decremented. FALSE indicates that the reference count should not be decremented.
258+
For out-of-process connections, this parameter must be TRUE, and indicates that creating the connection should cause the reference count of *pUnkSink* to be decremented.
259+
260+
For in-process connections, TRUE indicates that creating the connection should cause the reference count of *pUnkSink* to be decremented. FALSE indicates that the reference count should not be decremented.
261+
262+
**Warning**: In general, it cannot be predicted which connections are in-process and which connections are out-of-process, so it is recommended to always set this parameter to TRUE.
254263

255264
*dwCookie*<br/>
256265
The connection identifier returned by `AfxConnectionAdvise`.
@@ -270,3 +279,4 @@ Nonzero if a connection was disconnected; otherwise 0.
270279
## See also
271280

272281
[Macros and Globals](../../mfc/reference/mfc-macros-and-globals.md)
282+

0 commit comments

Comments
 (0)