Teilen über


Compilerfehler C3373

Das Attribut 'attribute' hat keine Argumente, außer bei einer Co-Klasse

Bemerkungen

Einige Attribute können auf mehr als ein C++-Konstrukt angewendet werden, Argumente für das Attribut sind jedoch möglicherweise nur bei einigen Konstrukten zulässig.

Example

Im folgenden Beispiel wird C3373 generiert:

// C3373.cpp
#include <windows.h>

[module(name="MyModule")];

[ object, uuid(373a1a4c-469b-11d3-a6b0-00c04f79ae8f) ]
__interface IMyIface
{
   // arguments to source and restricted are not allowed when
   // these attributes are applied to an interface
   [source(IMyIface)] HRESULT f1();
   [restricted(IMyIface)] HRESULT f2(); // C3373
};

[ coclass, uuid(373a1a4d-469b-11d3-a6b0-00c04f79ae8f) ]
class CMyClass : public IMyIface {
};

int main() {
}