Reputation: 165
I've got a piece of legacy code written in Delphi, long before I jointed the company and the behaviour of my IDE makes me doubt a lot of my own skills.
After loading a DLL and assigning the functions OpenDB, GetError and GetErrorStr from the DLL, this code gets called:
If @OpenDB <> nil then
begin
DB_num := OpenDB((PAnsiChar(file)));
if DB_num = -1 then
begin
err := GetError;
ErrorString := GetErrorString(err);
raise Exception.Create(ErrorString);
Exit;
end
end else
Exit;
OpenDB returns -1 and GetErrorString returns an error message and the exception is raised. No big deal, faulty databases exist and errors can always happen. What gets me is, that after the exception is raised, "...application-defined exception (code 0x0eedfade) at ..." pops up. After that I get access violations.
Upvotes: 1
Views: 3330
Reputation: 595971
The error message means that you are raising a Delphi exception across module boundaries into a piece of code that does not know how to handle Delphi exceptions. 0x0EEDFADE
is the value that the Delphi raise
statement passes to the dwExceptionCode
parameter of the Win32 RaiseException()
function. Only the Delphi and C++Builder RTLs know how to handle those kind of exceptions. You must never raise an exception across module boundaries, because one module does not know if another module can handle it. Different modules can be written in different languages/frameworks.
Upvotes: 4