External Exception EEFFACE

From RAD Studio
Jump to: navigation, search

Go Up to Exception Handling in C++Builder

External Exception EEFFACE is an error message that appears when a C++ exception is not caught by C++ exception handlers, and the exception is eventually handled by Delphi exception handlers.

EEFFACE.png

This error can occur in either a VCL forms application or a FireMonkey application when C++ exceptions are not caught explicitly and are leaked into the VCL or FireMonkey framework. These frameworks have Delphi exception handlers that, by default, handle the C++ exception, and therefore generate an External Exception EEFFACE.

Example

The following example is a VCL Forms Application that defines a C++ exception class - CppException. The application throws a CppException but does not catch the exception. Because the C++ exception is not caught by a C++ exception handler, the External Exception EEFFACE error message is generated.

// ---------------------------------------------------------------------------
class CppException : public std::exception {
	virtual const char* what() const throw() {
		return "C++ exception message";
	}
};

// ---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner) : TForm(Owner) {
}

// ---------------------------------------------------------------------------
int myfunction(int i) {
	if (i == 0) {
		throw new CppException();
	}
	return i - 1;
}

// ---------------------------------------------------------------------------
void __fastcall TForm2::Button1Click(TObject *Sender) {
	myfunction(0);
}

For more detailed information on this issue, please see: http://www.audacia-software.de/en/bcb/external-exception-eefface.htm .

See Also