Compiler Error C3353

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C3353.

delegate' : a delegate can only be created from a global function or a member function of a managed or WinRT type

Delegates, declared with the __delegate or delegate (C++ Component Extensions) keyword, can only be declared at global scope.

The following sample generates C3353:

// C3353.cpp  
// compile with: /clr  
delegate int f;   // C3353  

Show: