Skip to content

Commit e8f629f

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C3711, C3740]
1 parent d3c98f8 commit e8f629f

23 files changed

+78
-0
lines changed

docs/error-messages/compiler-errors-2/compiler-error-c3711.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 26d581cc-2153-4ee0-b814-a371184be3e1
1010

1111
> 'method': an non-managed event source method must return void or an integral type
1212
13+
## Remarks
14+
1315
You defined a method in the event source that did not return void or an integral type. To fix this error, make the event and event handler have a return type of **`void`** or an integral type such as **`int`** or **`long`**.
1416

17+
## Example
18+
1519
The following sample generates C3711:
1620

1721
```cpp

docs/error-messages/compiler-errors-2/compiler-error-c3712.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 65b1fcaf-be89-4c55-9e40-25ec03457253
1010

1111
> 'method': an event handler method must return the same type as the source 'method'
1212
13+
## Remarks
14+
1315
You defined an event handler method that did not return the same type as the source event method. To fix this error, give the event handler method the same return type as that of the source event method.
1416

17+
## Example
18+
1519
The following sample generates C3712:
1620

1721
```cpp

docs/error-messages/compiler-errors-2/compiler-error-c3713.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 75c6b9b6-955b-49bd-9bc8-ced88b496a1f
1010

1111
> 'method': an event handler method must have the same function parameters as the source 'method'
1212
13+
## Remarks
14+
1315
You defined an event handler method that did not use the same parameters as the source event method. To fix this error, give the event handler method the same parameters as those of the source event method.
1416

17+
## Example
18+
1519
The following sample generates C3713:
1620

1721
```cpp

docs/error-messages/compiler-errors-2/compiler-error-c3714.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 17718f75-5a37-4e42-912b-487e91008a95
1010

1111
> 'method': an event handler method must have the same calling convention as the source 'method'
1212
13+
## Remarks
14+
1315
You defined an event handler method that did not use the same calling convention as the source event method. To fix this error, give the event handler method the same calling conventions as those of the source event method. For example, in the code below, make the calling conventions of `handler1` and `event1` match ([__cdecl](../../cpp/cdecl.md) or [__stdcall](../../cpp/stdcall.md) or others). Removing calling convention keywords from both declarations will also solve the problem, and cause `event1` and `handler1` to default to the [thiscall](../../cpp/thiscall.md) calling convention. See [Calling Conventions](../../cpp/calling-conventions.md) for more information.
1416

17+
## Example
18+
1519
The following sample generates C3714:
1620

1721
```cpp

docs/error-messages/compiler-errors-2/compiler-error-c3715.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: ee5dce88-ddc4-4bdb-9464-47467ce1674f
1010

1111
> 'pointer': must be a pointer to 'class'
1212
13+
## Remarks
14+
1315
You specified a pointer in [`__hook`](../../cpp/hook.md) or [`__unhook`](../../cpp/unhook.md) that did not point to a valid class. To fix this error, ensure that your **`__hook`** and **`__unhook`** calls specify pointers to valid classes.

docs/error-messages/compiler-errors-2/compiler-error-c3717.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: ae4fceb1-2583-4577-b2f1-40971a017055
1010

1111
> 'method': a method that fires events cannot be defined
1212
13+
## Remarks
14+
1315
You declared an event method that includes an implementation. An [__event](../../cpp/event.md) method declaration cannot have a definition. To fix this error, ensure that no event method declarations have definitions. For example, in the code below, remove the function body from the `event1` declaration as indicated by the comments.
1416

17+
## Example
18+
1519
The following sample generates C3717:
1620

1721
```cpp

docs/error-messages/compiler-errors-2/compiler-error-c3718.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 346b5205-c44d-49d3-b66a-96417d3d6986
1010

1111
> can only call '*event*' in the context of a member function of the receiving class
1212
13+
## Remarks
14+
1315
The event can only be called from the receiving class.
1416

1517
## Example

docs/error-messages/compiler-errors-2/compiler-error-c3719.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: d0d59d4e-babb-4480-9ef7-70cf1a28165c
1010

1111
> 'interface': an interface based event source can only be used for COM events
1212
13+
## Remarks
14+
1315
You declared an interface in a non-COM context.
1416

17+
## Example
18+
1519
The following sample generates C3719:
1620

1721
```cpp

docs/error-messages/compiler-errors-2/compiler-error-c3721.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: c696ca38-3e00-4875-abbe-7bce0f46930e
1010

1111
> 'signature': incompatible signature for event
1212
13+
## Remarks
14+
1315
An event was declared incorrectly. For more information, see [__event](../../cpp/event.md).
1416

1517
C3721 is only reachable using the obsolete compiler option **/clr:oldSyntax**.

docs/error-messages/compiler-errors-2/compiler-error-c3722.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 3cb28363-5eff-4548-bd0d-d5c615846353
1010

1111
> a generic event is not allowed
1212
13+
## Remarks
14+
1315
The compiler only allows generic classes, structs, and functions. For more information, see [Generics](../../extensions/generics-cpp-component-extensions.md).
1416

17+
## Example
18+
1519
The following sample generates C3722:
1620

1721
```cpp

0 commit comments

Comments
 (0)