Delphi XE2 FireMonkey HD Applications Raise Runtime Error 231 on Mac OS X
Many users have encountered the problem when running FireMonkey HD Applications on Mac OS X without 3D hardware HAL. When this application is run, it either freezes or produces the following error:
Runtime error 231 at 000169AD
We have researched this problem and found a solution from Embarcadero.
If a Mac OS X computer has no 3D hardware HAL, you need to set the global variable FMX.Types.GlobalUseHWEffects to False. Example:
begin
FMX.Types.GlobalUseHWEffects := False;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end;
However, this solution is not a panacea. Sometimes HD Applications continue to freeze or raise the error even with FMX.Types.GlobalUseHWEffects set to False. In this case, you need to modify the FMX.Filter.pas unit. Do the following:
- Copy the FMX.Filter.pas and FMX.Defines.inc files from the $(BDS)sourcefmx folder to your project folder.
- In the files copied to your project folder replace the code of the FilterByName and FilterClassByName functions with the following code:
function FilterByName(const AName: string): TFilter; var i: Integer; begin Result := nil; if not GlobalUseHWEffects or (Filters = nil) then // <-- change this line Exit; for i := 0 to Filters.Count - 1 do if CompareText(TFilterClass(Filters.Objects[i]).FilterAttr.Name, AName) = 0 then begin Result := TFilterClass(Filters.Objects[i]).Create; Exit; end; end; function FilterClassByName(const AName: string): TFilterClass; var i: Integer; begin Result := nil; if not GlobalUseHWEffects or (Filters = nil) then // <-- change this line Exit; for i := 0 to Filters.Count - 1 do if CompareText(TFilterClass(Filters.Objects[i]).FilterAttr.Name, AName) = 0 then begin Result := TFilterClass(Filters.Objects[i]); Exit; end; end;
- Add the FMX.Filter unit to the USES section of your project:
program Project1; uses FMX.Forms, FMX.Types, FMX.Filter, // <-- add unit Unit1 in 'Unit1.pas' {Form1};
After such modifications your applications will run successfully on Mac OS X without 3D hardware HAL; however, 3D effects will not be available for it.
Updated:
This trick is not required for Rad Studio XE2 with Update 3 and higher.
- 14 New ODBC Drivers for Cloud Data Warehouses and Services Released - August 10, 2022
- SecureBridge 10.1 Released - July 5, 2022
- Configuring an ODBC Driver Manager on Windows, macOS, and Linux - June 30, 2022
June 3rd, 2013 at 6:21 pm
You’re in point of fact a just right webmaster. The website loading pace is amazing. It kind of feels that you are doing any distinctive trick. Also, The contents are masterpiece. you’ve done a great task on this subject!
October 24th, 2013 at 10:47 am
Thanks for your kind words. We are trying our best.
June 8th, 2013 at 3:10 pm
I enjoy, cause I found just what I was looking for. You have ended my 4 day long hunt! God Bless you man. Have a great day. Bye
October 24th, 2013 at 10:39 am
Thanks for your praising comment! Glad to be helpful.
July 24th, 2017 at 6:52 am
Delphi Tokyo does the same! And the filter.pas is completely different code now, no idea what to fix.
August 1st, 2017 at 10:10 am
Hello, Softtouch!
We did not have similar problems on Delphi Tokyo, so it’s difficult for us to recommend something. If we find a solution to your issue, we will definitely write how to solve it.