I’m trying to catch an UnauthorizedAccessException, but
catch(UnauthorizedAccessException uae)
{
return FALSE;
}
gives the compiler error “unable to throw or catch a managed object by value or reference” and “cannot be caught as the destructor and/or copy constructor are inaccessible”. If I try to catch as a pointer to the exception or by reference, it complains this exception cannot be handled by such a level of indirection.
You should catch by CLI pointer: