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
5 changes: 3 additions & 2 deletions docs/error-messages/compiler-errors-2/compiler-error-c3251.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
description: "Learn more about: Compiler Error C3251"
title: "Compiler Error C3251"
description: "Learn more about: Compiler Error C3251"
ms.date: 06/01/2022
f1_keywords: ["C3251"]
helpviewer_keywords: ["C3251"]
ms.assetid: 541c163e-5ee9-457c-a1e5-da860788b10d
---
# Compiler Error C3251

> cannot invoke base class method on a value type instance

## Remarks

The following error occurs because `GetClass` is a member of `Microsoft.Runtime.Object`, not of `Microsoft.Runtime.Integer4`.

This error is obsolete in Visual Studio 2022 and later versions.
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3252.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
---
description: "Learn more about: Compiler Error C3252"
title: "Compiler Error C3252"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3252"
ms.date: 11/04/2016
f1_keywords: ["C3252"]
helpviewer_keywords: ["C3252"]
ms.assetid: aa9ad096-e9ac-41c7-8ad9-b966751c7c75
---
# Compiler Error C3252

'method' : cannot reduce accessibility of a virtual method in a managed or WinRT type
> 'method' : cannot reduce accessibility of a virtual method in a managed or WinRT type

## Remarks

A class that implements a virtual method from a base class or any method from an interface cannot reduce the access of that method.

Note that all methods in an interface are public.

The following sample generates C3252 and shows how to fix it:
## Example

The following example generates C3252 and shows how to fix it:

```cpp
// C3252.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3253.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3253"
title: "Compiler Error C3253"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3253"
ms.date: 11/04/2016
f1_keywords: ["C3253"]
helpviewer_keywords: ["C3253"]
ms.assetid: da40be26-0f78-4730-8727-ad11cddf8869
---
# Compiler Error C3253

'function' : error with explicit override
> 'function' : error with explicit override

## Remarks

An explicit override was specified incorrectly. For example, you cannot specify an implementation for an override that you also specify as pure. For more information, see [Explicit Overrides](../../extensions/explicit-overrides-cpp-component-extensions.md).

The following sample generates C3253:
## Example

The following example generates C3253:

```cpp
// C3253.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3254.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3254"
title: "Compiler Error C3254"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3254"
ms.date: 11/04/2016
f1_keywords: ["C3254"]
helpviewer_keywords: ["C3254"]
ms.assetid: 93427b10-fa72-4e43-80d1-1a6e122f9f40
---
# Compiler Error C3254

'explicit override' : class contains explicit override 'override' but does not derive from an interface that contains the function declaration
> 'explicit override' : class contains explicit override 'override' but does not derive from an interface that contains the function declaration

## Remarks

When you [explicitly override](../../cpp/explicit-overrides-cpp.md) a method, the class that contains the override must derive, directly or indirectly, from the type that contains the function you are overriding.

The following sample generates C3254:
## Example

The following example generates C3254:

```cpp
// C3254.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3255.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3255"
title: "Compiler Error C3255"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3255"
ms.date: 11/04/2016
f1_keywords: ["C3255"]
helpviewer_keywords: ["C3255"]
ms.assetid: 877ffca2-fd92-44b6-9060-6091b928b1c1
---
# Compiler Error C3255

'value type' : cannot dynamically allocate this value type object on native heap
> 'value type' : cannot dynamically allocate this value type object on native heap

## Remarks

Instances of a value type (see [Classes and Structs](../../extensions/classes-and-structs-cpp-component-extensions.md)) that contain managed members can be created on the stack but not on the heap.

The following sample generates C3255:
## Example

The following example generates C3255:

```cpp
// C3255.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3262.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3262"
title: "Compiler Error C3262"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3262"
ms.date: 11/04/2016
f1_keywords: ["C3262"]
helpviewer_keywords: ["C3262"]
ms.assetid: 3e74b9aa-de3c-4492-9331-ee73012b958b
---
# Compiler Error C3262

invalid array indexing: '#' dimension(s) specified for '#'-dimensional 'array type'
> invalid array indexing: '#' dimension(s) specified for '#'-dimensional 'array type'

## Remarks

An array was improperly subscripted. The number of indices may not match the number of dimensions in the array.

The following sample generates C3262:
## Example

The following example generates C3262:

```cpp
// C3262.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3264.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3264"
title: "Compiler Error C3264"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3264"
ms.date: 11/04/2016
f1_keywords: ["C3264"]
helpviewer_keywords: ["C3264"]
ms.assetid: 94ece687-2364-4f7a-8ebb-7afd3ae9d63d
---
# Compiler Error C3264

'class' : a class-constructor cannot have a return type
> 'class' : a class-constructor cannot have a return type

## Remarks

Class constructors cannot have return types.

The following sample generates C3264:
## Example

The following example generates C3264:

```cpp
// C3264_2.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3265.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3265"
title: "Compiler Error C3265"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3265"
ms.date: 11/04/2016
f1_keywords: ["C3265"]
helpviewer_keywords: ["C3265"]
ms.assetid: 10ab3e17-4a9f-4120-bab5-21473869b70f
---
# Compiler Error C3265

cannot declare a managed 'managed construct' in an unmanaged 'unmanaged construct'
> cannot declare a managed 'managed construct' in an unmanaged 'unmanaged construct'

## Remarks

You cannot include a managed object in an unmanaged context.

The following sample reproduces C3265:
## Example

The following example reproduces C3265:

```cpp
// C3265_2.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3266.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3266"
title: "Compiler Error C3266"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3266"
ms.date: 11/04/2016
f1_keywords: ["C3266"]
helpviewer_keywords: ["C3266"]
ms.assetid: 7375c099-acb7-42f6-898d-57cfefa010b8
---
# Compiler Error C3266

'class' : a class-constructor must have a 'void' parameter list
> 'class' : a class-constructor must have a 'void' parameter list

## Remarks

Class-constructors in a class using /clr programming cannot take parameters.

The following sample generates C3266:
## Example

The following example generates C3266:

```cpp
// C3266.cpp
Expand Down
7 changes: 3 additions & 4 deletions docs/error-messages/compiler-errors-2/compiler-error-c3268.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Error C3268"
title: "Compiler Error C3268"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3268"
ms.date: 11/04/2016
f1_keywords: ["C3268"]
helpviewer_keywords: ["C3268"]
ms.assetid: d74a630c-daea-4e29-9759-83efef7fb184
---
# Compiler Error C3268

Expand All @@ -18,7 +17,7 @@ See [Generics](../../extensions/generics-cpp-component-extensions.md) for more i

## Example

The following sample generates C3268.
The following example generates C3268.

```cpp
// C3268.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3269.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3269"
title: "Compiler Error C3269"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3269"
ms.date: 11/04/2016
f1_keywords: ["C3269"]
helpviewer_keywords: ["C3269"]
ms.assetid: c575f067-244d-4dd5-bf58-9e7630ea58b7
---
# Compiler Error C3269

'function' : a member-function of a managed or WinRTtype cannot be declared with '...'
> 'function' : a member-function of a managed or WinRTtype cannot be declared with '...'

## Remarks

Managed and WinRT class member functions cannot declare variable-length parameter lists.

The following sample generates C3269 and shows how to fix it:
## Example

The following example generates C3269 and shows how to fix it:

```cpp
// C3269_2.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3270.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3270"
title: "Compiler Error C3270"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3270"
ms.date: 11/04/2016
f1_keywords: ["C3270"]
helpviewer_keywords: ["C3270"]
ms.assetid: 70e6e76b-7415-48f5-a61e-2ed50caf08e4
---
# Compiler Error C3270

'field': the FieldOffset attribute can only be used in the context of StructLayout(Explicit), in which case it is required
> 'field': the FieldOffset attribute can only be used in the context of StructLayout(Explicit), in which case it is required

## Remarks

A field was marked with **FieldOffset**, which is only allowed when **StructLayout(Explicit)** is in effect.

The following sample generates C3270:
## Example

The following example generates C3270:

```cpp
// C3270_2.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3271.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3271"
title: "Compiler Error C3271"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3271"
ms.date: 11/04/2016
f1_keywords: ["C3271"]
helpviewer_keywords: ["C3271"]
ms.assetid: 16d8bd1d-2e30-4c6a-a07f-0c4f3342fab5
---
# Compiler Error C3271

'member': invalid value 'value' for the FieldOffset attribute
> 'member': invalid value 'value' for the FieldOffset attribute

## Remarks

A negative number was passed to the **FieldOffset** attribute.

The following sample generates C3271:
## Example

The following example generates C3271:

```cpp
// C3271.cpp
Expand Down
13 changes: 8 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3272.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
description: "Learn more about: Compiler Error C3272"
title: "Compiler Error C3272"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3272"
ms.date: 11/04/2016
f1_keywords: ["C3272"]
helpviewer_keywords: ["C3272"]
ms.assetid: 7cdf254d-f207-4116-a1bf-7386f3b82a6f
---
# Compiler Error C3272

'symbol' : symbol requires FieldOffset, as it is a member of type typename defined with StructLayout(LayoutKind::Explicit)
> 'symbol' : symbol requires FieldOffset, as it is a member of type typename defined with StructLayout(LayoutKind::Explicit)

## Remarks

When `StructLayout(LayoutKind::Explicit)` is in effect, fields must be marked with `FieldOffset`.

The following sample generates C3272:
## Example

The following example generates C3272:

```cpp
// C3272_2.cpp
Expand Down
11 changes: 6 additions & 5 deletions docs/error-messages/compiler-errors-2/compiler-error-c3273.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
description: "Learn more about: Compiler Error C3273"
title: "Compiler Error C3273"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C3273"
ms.date: 11/04/2016
f1_keywords: ["C3273"]
helpviewer_keywords: ["C3273"]
ms.assetid: 1d2ce9d9-222b-4cab-94e2-d2c1a9f5ebe0
---
# Compiler Error C3273

__finally cannot be used on an exception block in unmanaged code.
> __finally cannot be used on an exception block in unmanaged code.

## Example

The following sample generates C3273:
The following example generates C3273:

```cpp
// C3273.cpp
Expand Down
Loading