Delen via


Compilerfout C3274

__finally/ten slotte zonder overeenkomende poging

Opmerkingen

Er is een __finally of finally statement gevonden zonder een overeenkomend try. U kunt dit oplossen door de __finally instructie te verwijderen of een try instructie toe te voegen voor de __finally.

Example

In het volgende voorbeeld wordt C3274 gegenereerd:

// C3274.cpp
// compile with: /clr
// C3274 expected
using namespace System;
int main() {
   try {
      try {
         throw gcnew ApplicationException();
      }
      catch(...) {
         Console::Error->WriteLine(L"Caught an exception");
      }
      finally {
         Console::WriteLine(L"In finally");
      }
   } finally {
      Console::WriteLine(L"In finally");
   }

   // Uncomment the following 3 lines to resolve.
   // try {
   //   throw gcnew ApplicationException();
   // }

   finally {
      Console::WriteLine(L"In finally");
   }
   Console::WriteLine(L"**FAIL**");
}