Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3711.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3711"
title: "Compiler Error C3711"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3711"
ms.date: 11/04/2016
f1_keywords: ["C3711"]
helpviewer_keywords: ["C3711"]
ms.assetid: 26d581cc-2153-4ee0-b814-a371184be3e1
---
# Compiler Error C3711

'method': an non-managed event source method must return void or an integral type
> 'method': an non-managed event source method must return void or an integral type

## Remarks

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`**.

The following sample generates C3711:
## Example

The following example generates C3711:

```cpp
// C3711.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3712.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3712"
title: "Compiler Error C3712"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3712"
ms.date: 11/04/2016
f1_keywords: ["C3712"]
helpviewer_keywords: ["C3712"]
ms.assetid: 65b1fcaf-be89-4c55-9e40-25ec03457253
---
# Compiler Error C3712

'method': an event handler method must return the same type as the source 'method'
> 'method': an event handler method must return the same type as the source 'method'

## Remarks

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.

The following sample generates C3712:
## Example

The following example generates C3712:

```cpp
// C3712.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3713.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3713"
title: "Compiler Error C3713"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3713"
ms.date: 11/04/2016
f1_keywords: ["C3713"]
helpviewer_keywords: ["C3713"]
ms.assetid: 75c6b9b6-955b-49bd-9bc8-ced88b496a1f
---
# Compiler Error C3713

'method': an event handler method must have the same function parameters as the source 'method'
> 'method': an event handler method must have the same function parameters as the source 'method'

## Remarks

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.

The following sample generates C3713:
## Example

The following example generates C3713:

```cpp
// C3713.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3714.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3714"
title: "Compiler Error C3714"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3714"
ms.date: 11/04/2016
f1_keywords: ["C3714"]
helpviewer_keywords: ["C3714"]
ms.assetid: 17718f75-5a37-4e42-912b-487e91008a95
---
# Compiler Error C3714

'method': an event handler method must have the same calling convention as the source 'method'
> 'method': an event handler method must have the same calling convention as the source 'method'

## Remarks

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.

The following sample generates C3714:
## Example

The following example generates C3714:

```cpp
// C3714.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3715.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Error C3715"
title: "Compiler Error C3715"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3715"
ms.date: 11/04/2016
f1_keywords: ["C3715"]
helpviewer_keywords: ["C3715"]
ms.assetid: ee5dce88-ddc4-4bdb-9464-47467ce1674f
---
# Compiler Error C3715

'pointer': must be a pointer to 'class'
> 'pointer': must be a pointer to 'class'

## Remarks

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.
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3717.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3717"
title: "Compiler Error C3717"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3717"
ms.date: 11/04/2016
f1_keywords: ["C3717"]
helpviewer_keywords: ["C3717"]
ms.assetid: ae4fceb1-2583-4577-b2f1-40971a017055
---
# Compiler Error C3717

'method': a method that fires events cannot be defined
> 'method': a method that fires events cannot be defined

## Remarks

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.

The following sample generates C3717:
## Example

The following example generates C3717:

```cpp
// C3717.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3718.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
description: "Learn more about: Compiler Error C3718"
title: "Compiler Error C3718"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3718"
ms.date: 11/04/2016
f1_keywords: ["C3718"]
helpviewer_keywords: ["C3718"]
ms.assetid: 346b5205-c44d-49d3-b66a-96417d3d6986
---
# Compiler Error C3718

> can only call '*event*' in the context of a member function of the receiving class

## Remarks

The event can only be called from the receiving class.

## Example

The following sample generates C3718:
The following example generates C3718:

```cpp
// C3718.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3719.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3719"
title: "Compiler Error C3719"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3719"
ms.date: 11/04/2016
f1_keywords: ["C3719"]
helpviewer_keywords: ["C3719"]
ms.assetid: d0d59d4e-babb-4480-9ef7-70cf1a28165c
---
# Compiler Error C3719

'interface': an interface based event source can only be used for COM events
> 'interface': an interface based event source can only be used for COM events

## Remarks

You declared an interface in a non-COM context.

The following sample generates C3719:
## Example

The following example generates C3719:

```cpp
// C3719a.cpp
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3721.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Error C3721"
title: "Compiler Error C3721"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3721"
ms.date: 11/04/2016
f1_keywords: ["C3721"]
helpviewer_keywords: ["C3721"]
ms.assetid: c696ca38-3e00-4875-abbe-7bce0f46930e
---
# Compiler Error C3721

'signature': incompatible signature for event
> 'signature': incompatible signature for event

## Remarks

An event was declared incorrectly. For more information, see [__event](../../cpp/event.md).

Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3722.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3722"
title: "Compiler Error C3722"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3722"
ms.date: 11/04/2016
f1_keywords: ["C3722"]
helpviewer_keywords: ["C3722"]
ms.assetid: 3cb28363-5eff-4548-bd0d-d5c615846353
---
# Compiler Error C3722

a generic event is not allowed
> a generic event is not allowed

## Remarks

The compiler only allows generic classes, structs, and functions. For more information, see [Generics](../../extensions/generics-cpp-component-extensions.md).

The following sample generates C3722:
## Example

The following example generates C3722:

```cpp
// C3722.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3723.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3723"
title: "Compiler Error C3723"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3723"
ms.date: 11/04/2016
f1_keywords: ["C3723"]
helpviewer_keywords: ["C3723"]
ms.assetid: ef0fb1ff-3f9a-4093-a6b6-894d1ab0c4b9
---
# Compiler Error C3723

> 'function': could not resolve event

## Remarks

`function` could not resolve which event to call.

The following sample generates C3723:
## Examples

The following example generates C3723:

```cpp
// C3723.cpp
Expand All @@ -37,7 +40,7 @@ int main() {

**`__hook`** and **`__unhook`** are not compatible with **`/clr`** programming. Use the += and -= operators instead.

The following sample generates C3723:
The following example generates C3723:

```cpp
// C3723b.cpp
Expand Down
13 changes: 9 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3724.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
---
description: "Learn more about: Compiler Error C3724"
title: "Compiler Error C3724"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3724"
ms.date: 11/04/2016
f1_keywords: ["C3724"]
helpviewer_keywords: ["C3724"]
ms.assetid: cab8aba7-14fc-406f-8cc6-32744c8f31c1
---
# Compiler Error C3724

must #include \<windows.h> to use multi-threading with events
> must #include \<windows.h> to use multi-threading with events

## Remarks

The windows.h file is required if you use multi-threading with events. To fix this error, add `#include <windows.h>` to the top of the file in which event sources and event receivers are defined.

## Example

The following example generates C3724:

```cpp
// C3724.cpp
// uncomment the following line to resolve
Expand Down
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3727.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
description: "Learn more about: Compiler Error C3727"
title: "Compiler Error C3727"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3727"
ms.date: 11/04/2016
f1_keywords: ["C3727"]
helpviewer_keywords: ["C3727"]
ms.assetid: 17b9fe7b-ee9e-483f-9c27-1f709255a9e0
---
# Compiler Error C3727

'event': a managed event must be a member function or a data member that is a pointer to a delegate
> 'event': a managed event must be a member function or a data member that is a pointer to a delegate

## Remarks

.NET events must be a pointer to a delegate type.
9 changes: 5 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3728.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
description: "Learn more about: Compiler Error C3728"
title: "Compiler Error C3728"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3728"
ms.date: 11/04/2016
f1_keywords: ["C3728"]
helpviewer_keywords: ["C3728"]
ms.assetid: 6b510cb1-887f-4fcd-9a1f-3bb720417ed1
---
# Compiler Error C3728

'event': event does not have a raise method
> 'event': event does not have a raise method

## Remarks

Metadata created with a language, such as C#, that does not allow an event to be raised from outside the class in which it was defined, was included with the [#using](../../preprocessor/hash-using-directive-cpp.md) directive, and a Visual C++ program using CLR programming attempted to raise the event.

Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3731.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3731"
title: "Compiler Error C3731"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3731"
ms.date: 11/04/2016
f1_keywords: ["C3731"]
helpviewer_keywords: ["C3731"]
ms.assetid: 45f89fcd-464c-4bc8-8a42-edcb5416d26c
---
# Compiler Error C3731

incompatible event 'function1' and handler 'function2'; event source and event handler must be the same type
> incompatible event 'function1' and handler 'function2'; event source and event handler must be the same type

## Remarks

The event source and event receiver must have the same type (for example `native` vs. `com` types). To fix this error, make the types of the event source and the event handler match.

The following sample generates C3731:
## Example

The following example generates C3731:

```cpp
// C3731.cpp
Expand Down
Loading