Mega Code Archive

 
Categories / Visual C++ .NET / Statement
 

Throw gcnew exception

#include "stdafx.h" using namespace System; int main() { try {      bool error = true;      // other code      if (error)      {           throw gcnew Exception();      } } catch( Exception^ exception) {       // code to handle the exception } }