Megosztás a következőn keresztül:


C3342 fordítási hiba

"attribútum": nem egyértelmű attribútum

Megjegyzések

A fordító egy attribútum több definícióját is megtalálta.

Egy attribútumot többször definiáltak.

További információ: User-Defined Attribútumok.

Example

Az alábbi példa C3342-t hoz létre.

// C3342.cpp
// compile with: /clr /c
using namespace System;
using namespace System::Reflection;

[AttributeUsage(AttributeTargets::All)]
public ref class XAttribute : public  Attribute {};

[AttributeUsage(AttributeTargets::All)]
public ref class X : public Attribute {};

[X]   // C3342 could refer to X or XAttribute
// try the following line instead
// [XAttribute]
public ref class Class4 {};