Skip to content

Commit 1120fd5

Browse files
author
mtx48109
committed
format mfc reference pr15
1 parent f358f7e commit 1120fd5

30 files changed

+1803
-1800
lines changed

docs/mfc/reference/csmoothstoptransition-class.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ virtual BOOL Create(
6565
```
6666

6767
### Parameters
68-
`pLibrary`
68+
*pLibrary*
6969
A pointer to transition library, which is responsible for creation of standard transitions.
7070

7171
### Return Value
@@ -81,10 +81,10 @@ CSmoothStopTransition(
8181
```
8282

8383
### Parameters
84-
`maximumDuration`
84+
*maximumDuration*
8585
The maximum duration of the transition.
8686

87-
`dblFinalValue`
87+
*dblFinalValue*
8888
The value of the animation variable at the end of the transition.
8989

9090
## <a name="m_dblfinalvalue"></a> CSmoothStopTransition::m_dblFinalValue

docs/mfc/reference/csocket-class.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ class CSocket : public CAsyncSocket
3333

3434
|Name|Description|
3535
|----------|-----------------|
36-
|[CSocket::Attach](#attach)|Attaches a **SOCKET** handle to a `CSocket` object.|
36+
|[CSocket::Attach](#attach)|Attaches a SOCKET handle to a `CSocket` object.|
3737
|[CSocket::CancelBlockingCall](#cancelblockingcall)|Cancels a blocking call that is currently in progress.|
3838
|[CSocket::Create](#create)|Creates a socket.|
39-
|[CSocket::FromHandle](#fromhandle)|Returns a pointer to a `CSocket` object, given a **SOCKET** handle.|
39+
|[CSocket::FromHandle](#fromhandle)|Returns a pointer to a `CSocket` object, given a SOCKET handle.|
4040
|[CSocket::IsBlocking](#isblocking)|Determines whether a blocking call is in progress.|
4141

4242
### Protected Methods
@@ -48,9 +48,9 @@ class CSocket : public CAsyncSocket
4848
## Remarks
4949
`CSocket` works with classes `CSocketFile` and `CArchive` to manage the sending and receiving of data.
5050

51-
A `CSocket` object also provides blocking, which is essential to the synchronous operation of `CArchive`. Blocking functions, such as `Receive`, `Send`, `ReceiveFrom`, `SendTo`, and `Accept` (all inherited from `CAsyncSocket`), do not return a `WSAEWOULDBLOCK` error in `CSocket`. Instead, these functions wait until the operation completes. Additionally, the original call will terminate with the error `WSAEINTR` if `CancelBlockingCall` is called while one of these functions is blocking.
51+
A `CSocket` object also provides blocking, which is essential to the synchronous operation of `CArchive`. Blocking functions, such as `Receive`, `Send`, `ReceiveFrom`, `SendTo`, and `Accept` (all inherited from `CAsyncSocket`), do not return a `WSAEWOULDBLOCK` error in `CSocket`. Instead, these functions wait until the operation completes. Additionally, the original call will terminate with the error WSAEINTR if `CancelBlockingCall` is called while one of these functions is blocking.
5252

53-
To use a `CSocket` object, call the constructor, then call `Create` to create the underlying `SOCKET` handle (type `SOCKET`). The default parameters of `Create` create a stream socket, but if you are not using the socket with a `CArchive` object, you can specify a parameter to create a datagram socket instead, or bind to a specific port to create a server socket. Connect to a client socket using `Connect` on the client side and `Accept` on the server side. Then create a `CSocketFile` object and associate it to the `CSocket` object in the `CSocketFile` constructor. Next, create a `CArchive` object for sending and one for receiving data (as needed), then associate them with the `CSocketFile` object in the `CArchive` constructor. When communications are complete, destroy the `CArchive`, `CSocketFile`, and `CSocket` objects. The `SOCKET` data type is described in the article [Windows Sockets: Background](../../mfc/windows-sockets-background.md).
53+
To use a `CSocket` object, call the constructor, then call `Create` to create the underlying SOCKET handle (type SOCKET). The default parameters of `Create` create a stream socket, but if you are not using the socket with a `CArchive` object, you can specify a parameter to create a datagram socket instead, or bind to a specific port to create a server socket. Connect to a client socket using `Connect` on the client side and `Accept` on the server side. Then create a `CSocketFile` object and associate it to the `CSocket` object in the `CSocketFile` constructor. Next, create a `CArchive` object for sending and one for receiving data (as needed), then associate them with the `CSocketFile` object in the `CArchive` constructor. When communications are complete, destroy the `CArchive`, `CSocketFile`, and `CSocket` objects. The SOCKET data type is described in the article [Windows Sockets: Background](../../mfc/windows-sockets-background.md).
5454

5555
When you use `CArchive` with `CSocketFile` and `CSocket`, you might encounter a situation where `CSocket::Receive` enters a loop (by `PumpMessages(FD_READ)`) waiting for the requested amount of bytes. This is because Windows sockets allow only one recv call per FD_READ notification, but `CSocketFile` and `CSocket` allow multiple recv calls per FD_READ. If you get an FD_READ when there is no data to read, the application hangs. If you never get another FD_READ, the application stops communicating over the socket.
5656

@@ -83,14 +83,14 @@ BOOL Attach(SOCKET hSocket);
8383
```
8484

8585
### Parameters
86-
`hSocket`
86+
*hSocket*
8787
Contains a handle to a socket.
8888

8989
### Return Value
9090
Nonzero if the function is successful.
9191

9292
### Remarks
93-
The **SOCKET** handle is stored in the object's [m_hSocket](../../mfc/reference/casyncsocket-class.md#m_hsocket) data member.
93+
The SOCKET handle is stored in the object's [m_hSocket](../../mfc/reference/casyncsocket-class.md#m_hsocket) data member.
9494

9595
For more information, see [Windows Sockets: Using Sockets with Archives](../../mfc/windows-sockets-using-sockets-with-archives.md).
9696

@@ -109,11 +109,11 @@ void CancelBlockingCall();
109109
```
110110

111111
### Remarks
112-
This function cancels any outstanding blocking operation for this socket. The original blocking call will terminate as soon as possible with the error **WSAEINTR**.
112+
This function cancels any outstanding blocking operation for this socket. The original blocking call will terminate as soon as possible with the error WSAEINTR.
113113

114-
In the case of a blocking **Connect** operation, the Windows Sockets implementation will terminate the blocking call as soon as possible, but it may not be possible for the socket resources to be released until the connection has completed (and then been reset) or timed out. This is likely to be noticeable only if the application immediately tries to open a new socket (if no sockets are available), or to connect to the same peer.
114+
In the case of a blocking `Connect` operation, the Windows Sockets implementation will terminate the blocking call as soon as possible, but it may not be possible for the socket resources to be released until the connection has completed (and then been reset) or timed out. This is likely to be noticeable only if the application immediately tries to open a new socket (if no sockets are available), or to connect to the same peer.
115115

116-
Canceling any operation other than **Accept** can leave the socket in an indeterminate state. If an application cancels a blocking operation on a socket, the only operation that the application can depend on being able to perform on the socket is a call to **Close**, although other operations may work on some Windows Sockets implementations. If you desire maximum portability for your application, you must be careful not to depend on performing operations after a cancel.
116+
Canceling any operation other than `Accept` can leave the socket in an indeterminate state. If an application cancels a blocking operation on a socket, the only operation that the application can depend on being able to perform on the socket is a call to `Close`, although other operations may work on some Windows Sockets implementations. If you desire maximum portability for your application, you must be careful not to depend on performing operations after a cancel.
117117

118118
For more information, see [Windows Sockets: Using Sockets with Archives](../../mfc/windows-sockets-using-sockets-with-archives.md).
119119

@@ -128,27 +128,27 @@ BOOL Create(
128128
```
129129

130130
### Parameters
131-
`nSocketPort`
131+
*nSocketPort*
132132
A particular port to be used with the socket, or 0 if you want MFC to select a port.
133133

134-
`nSocketType`
135-
**SOCK_STREAM** or **SOCK_DGRAM**.
134+
*nSocketType*
135+
SOCK_STREAM or SOCK_DGRAM.
136136

137-
`lpszSocketAddress`
138-
A pointer to a string containing the network address of the connected socket, a dotted number such as "128.56.22.8". Passing the **NULL** string for this parameter indicates the **CSocket** instance should listen for client activity on all network interfaces.
137+
*lpszSocketAddress*
138+
A pointer to a string containing the network address of the connected socket, a dotted number such as "128.56.22.8". Passing the NULL string for this parameter indicates the `CSocket` instance should listen for client activity on all network interfaces.
139139

140140
### Return Value
141141
Nonzero if the function is successful; otherwise 0, and a specific error code can be retrieved by calling `GetLastError`.
142142

143143
### Remarks
144-
**Create** then calls **Bind** to bind the socket to the specified address. The following socket types are supported:
144+
`Create` then calls `Bind` to bind the socket to the specified address. The following socket types are supported:
145145

146-
- **SOCK_STREAM** Provides sequenced, reliable, two-way, connection-based byte streams. Uses Transmission Control Protocol (TCP) for the Internet address family.
146+
- SOCK_STREAM Provides sequenced, reliable, two-way, connection-based byte streams. Uses Transmission Control Protocol (TCP) for the Internet address family.
147147

148-
- **SOCK_DGRAM** Supports datagrams, which are connectionless, unreliable buffers of a fixed (typically small) maximum length. Uses User Datagram Protocol (UDP) for the Internet address family. To use this option, you must not use the socket with a `CArchive` object.
148+
- SOCK_DGRAM Supports datagrams, which are connectionless, unreliable buffers of a fixed (typically small) maximum length. Uses User Datagram Protocol (UDP) for the Internet address family. To use this option, you must not use the socket with a `CArchive` object.
149149

150150
> [!NOTE]
151-
> The **Accept** member function takes a reference to a new, empty `CSocket` object as its parameter. You must construct this object before you call **Accept**. Keep in mind that if this socket object goes out of scope, the connection closes. Do not call **Create** for this new socket object.
151+
> The `Accept` member function takes a reference to a new, empty `CSocket` object as its parameter. You must construct this object before you call `Accept`. Keep in mind that if this socket object goes out of scope, the connection closes. Do not call `Create` for this new socket object.
152152
153153
For more information about stream and datagram sockets, see the articles [Windows Sockets: Background](../../mfc/windows-sockets-background.md), [Windows Sockets: Ports and Socket Addresses](../../mfc/windows-sockets-ports-and-socket-addresses.md), and [Windows Sockets: Using Sockets with Archives](../../mfc/windows-sockets-using-sockets-with-archives.md).
154154

@@ -160,7 +160,7 @@ CSocket();
160160
```
161161

162162
### Remarks
163-
After construction, you must call the **Create** member function.
163+
After construction, you must call the `Create` member function.
164164

165165
For more information, see [Windows Sockets: Using Sockets with Archives](../../mfc/windows-sockets-using-sockets-with-archives.md).
166166

@@ -172,14 +172,14 @@ static CSocket* PASCAL FromHandle(SOCKET hSocket);
172172
```
173173

174174
### Parameters
175-
`hSocket`
175+
*hSocket*
176176
Contains a handle to a socket.
177177

178178
### Return Value
179-
A pointer to a `CSocket` object, or **NULL** if there is no `CSocket` object attached to `hSocket`.
179+
A pointer to a `CSocket` object, or NULL if there is no `CSocket` object attached to *hSocket*.
180180

181181
### Remarks
182-
When given a **SOCKET** handle, if a `CSocket` object is not attached to the handle, the member function returns **NULL** and does not create a temporary object.
182+
When given a SOCKET handle, if a `CSocket` object is not attached to the handle, the member function returns NULL and does not create a temporary object.
183183

184184
For more information, see [Windows Sockets: Using Sockets with Archives](../../mfc/windows-sockets-using-sockets-with-archives.md).
185185

docs/mfc/reference/csocketfile-class.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ class CSocketFile : public CFile
3535
To serialize (send) data, you insert it into the archive, which calls `CSocketFile` member functions to write data to the `CSocket` object. To deserialize (receive) data, you extract from the archive. This causes the archive to call `CSocketFile` member functions to read data from the `CSocket` object.
3636

3737
> [!TIP]
38-
> Besides using `CSocketFile` as described here, you can use it as a stand-alone file object, just as you can with `CFile`, its base class. You can also use `CSocketFile` with any archive-based MFC serialization functions. Because `CSocketFile` does not support all of `CFile`'s functionality, some default MFC serialize functions are not compatible with `CSocketFile`. This is particularly true of the `CEditView` class. You should not try to serialize `CEditView` data through a `CArchive` object attached to a `CSocketFile` object using `CEditView::SerializeRaw`; use **CEditView::Serialize** instead. The `SerializeRaw` function expects the file object to have functions, such as `Seek`, that `CSocketFile` does not have.
38+
> Besides using `CSocketFile` as described here, you can use it as a stand-alone file object, just as you can with `CFile`, its base class. You can also use `CSocketFile` with any archive-based MFC serialization functions. Because `CSocketFile` does not support all of `CFile`'s functionality, some default MFC serialize functions are not compatible with `CSocketFile`. This is particularly true of the `CEditView` class. You should not try to serialize `CEditView` data through a `CArchive` object attached to a `CSocketFile` object using `CEditView::SerializeRaw`; use `CEditView::Serialize` instead. The `SerializeRaw` function expects the file object to have functions, such as `Seek`, that `CSocketFile` does not have.
3939
40-
When you use `CArchive` with `CSocketFile` and `CSocket`, you might encounter a situation where **CSocket::Receive** enters a loop (by **PumpMessages(FD_READ)**) waiting for the requested amount of bytes. This is because Windows sockets allow only one recv call per FD_READ notification, but `CSocketFile` and `CSocket` allow multiple recv calls per FD_READ. If you get an FD_READ when there is no data to read, the application hangs. If you never get another FD_READ, the application stops communicating over the socket.
40+
When you use `CArchive` with `CSocketFile` and `CSocket`, you might encounter a situation where `CSocket::Receive` enters a loop (by `PumpMessages(FD_READ)`) waiting for the requested amount of bytes. This is because Windows sockets allow only one recv call per FD_READ notification, but `CSocketFile` and `CSocket` allow multiple recv calls per FD_READ. If you get an FD_READ when there is no data to read, the application hangs. If you never get another FD_READ, the application stops communicating over the socket.
4141

42-
You can resolve this problem as follows. In the `OnReceive` method of your socket class, call **CAsyncSocket::IOCtl(FIONREAD, ...)** before you call the `Serialize` method of your message class when the expected data to be read from the socket exceeds the size of one TCP packet (maximum transmission unit of the network medium, usually at least 1096 bytes). If the size of the available data is less than needed, wait for all the data to be received and only then start the read operation.
42+
You can resolve this problem as follows. In the `OnReceive` method of your socket class, call `CAsyncSocket::IOCtl(FIONREAD, ...)` before you call the `Serialize` method of your message class when the expected data to be read from the socket exceeds the size of one TCP packet (maximum transmission unit of the network medium, usually at least 1096 bytes). If the size of the available data is less than needed, wait for all the data to be received and only then start the read operation.
4343

4444
In the following example, `m_dwExpected` is the approximate number of bytes that the user expects to receive. It is assumed that you declare it elsewhere in your code.
4545

@@ -67,17 +67,17 @@ explicit CSocketFile(
6767
```
6868

6969
### Parameters
70-
`pSocket`
70+
*pSocket*
7171
The socket to attach to the `CSocketFile` object.
7272

73-
`bArchiveCompatible`
74-
Specifies whether the file object is for use with a `CArchive` object. Pass **FALSE** only if you want to use the `CSocketFile` object in a stand-alone manner as you would a stand-alone `CFile` object, with certain limitations. This flag changes how the `CArchive` object attached to the `CSocketFile` object manages its buffer for reading.
73+
*bArchiveCompatible*
74+
Specifies whether the file object is for use with a `CArchive` object. Pass FALSE only if you want to use the `CSocketFile` object in a stand-alone manner as you would a stand-alone `CFile` object, with certain limitations. This flag changes how the `CArchive` object attached to the `CSocketFile` object manages its buffer for reading.
7575

7676
### Remarks
7777
The object's destructor disassociates itself from the socket object when the object goes out of scope or is deleted.
7878

7979
> [!NOTE]
80-
> A `CSocketFile` can also be used as a (limited) file without a `CArchive` object. By default, the `CSocketFile` constructor's `bArchiveCompatible` parameter is **TRUE**. This specifies that the file object is for use with an archive. To use the file object without an archive, pass **FALSE** in the `bArchiveCompatible` parameter.
80+
> A `CSocketFile` can also be used as a (limited) file without a `CArchive` object. By default, the `CSocketFile` constructor's *bArchiveCompatible* parameter is TRUE. This specifies that the file object is for use with an archive. To use the file object without an archive, pass FALSE in the *bArchiveCompatible* parameter.
8181
8282
In its "archive compatible" mode, a `CSocketFile` object provides better performance and reduces the danger of a "deadlock." A deadlock occurs when both the sending and receiving sockets are waiting on each other, or for a common resource. This situation might occur if the `CArchive` object worked with the `CSocketFile` the way it does with a `CFile` object. With `CFile`, the archive can assume that if it receives fewer bytes than it requested, the end of file has been reached.
8383

0 commit comments

Comments
 (0)