Compile problem for 64 bit
Posted: Mon Oct 24, 2011 10:30 am
Hi
If I try to compile one of my projects for 64 bit with Delphi XE2, I get the following 2 errors in siDialog.pas:
[DCC Error] siDialog.pas(1678): E2089 Invalid typecast
[DCC Error] siDialog.pas(1684): E2089 Invalid typecast
This 2 lines are part of procedure TsiBrowseForFolder.DoShow;
The problem seems to be that 64bit long variables are casted to LongInt which is still 32 bit:
SendMessage(FHandle, WM_SETTEXT, 0, LongInt(FDialogCaption));
SendMessage(FHandle, BFFM_SETSELECTION, LongInt(True), LongInt(FSelectedDir));
Would it be better to cast it to NativeInt? Because that is 32bit long for 32bit executables, and 64 bit long for 64 bit executables.
Best Regards
Ottiger Daniel
If I try to compile one of my projects for 64 bit with Delphi XE2, I get the following 2 errors in siDialog.pas:
[DCC Error] siDialog.pas(1678): E2089 Invalid typecast
[DCC Error] siDialog.pas(1684): E2089 Invalid typecast
This 2 lines are part of procedure TsiBrowseForFolder.DoShow;
The problem seems to be that 64bit long variables are casted to LongInt which is still 32 bit:
SendMessage(FHandle, WM_SETTEXT, 0, LongInt(FDialogCaption));
SendMessage(FHandle, BFFM_SETSELECTION, LongInt(True), LongInt(FSelectedDir));
Would it be better to cast it to NativeInt? Because that is 32bit long for 32bit executables, and 64 bit long for 64 bit executables.
Best Regards
Ottiger Daniel