Lasse

Forum Replies Created

Viewing 20 posts - 41 through 60 (of 205 total)
  • Author
    Posts
  • in reply to: Access Violation Delphi5 #71109
    Lasse
    Participant

    Which Delphi version you’re using?

    I am developing on Windows 11 but I still build versions for XP. I haven’t noticed any issues. I have created own build configurations for XP because with the latest Delphi version (11.2) you need to set PE Header to version 5.1 (two linker options). By default those are in version 6.0 and application will crash on XP with that version.

    in reply to: Hints not disappearing. #71106
    Lasse
    Participant

    Have you debugged for example TsAlphaHints.OnCheckTimer procedure? I think there was an issue at some point. I have done 150 fixes for AlphaSkins but none of those affects that…

    in reply to: Hints not disappearing. #71104
    Lasse
    Participant

    I have not noticed such behavior. Have you dropped the AlphaHints (TsAlphaHints) component into your application? I see I have done so.

    in reply to: Install problem Alexandria C++ #71101
    Lasse
    Participant

    As a Delphi user I am used to compiling and building packages. I see C++ Builder is calling it Make and Build. But I did only build it.

    Attachments:
    You must be logged in to view attached files.
    in reply to: Install problem Alexandria C++ #71097
    Lasse
    Participant

    I tried it again, no problem.

    Attachments:
    You must be logged in to view attached files.
    in reply to: Install problem Alexandria C++ #71095
    Lasse
    Participant

    I did install the package without any problems (see previous attachment, icon shows it is installed). I was beta testing upcoming Delphi 11.3 thou. I didn’t test this on Delphi 11.2. I haven’t changed any other settings in C++ project files.

    Did you build the run-time package first?

    • This reply was modified 1 year, 10 months ago by Lasse.
    in reply to: Install problem Alexandria C++ #71091
    Lasse
    Participant

    Just add vclwinx library and you can build the design package (see attachment).

    Attachments:
    You must be logged in to view attached files.
    in reply to: TsDateEdit date format #71090
    Lasse
    Participant

    You can, if you inherit that control and add published Format property. Then just override UpdateFormat and call it when Format property is set.

    in reply to: Sudden exception in acShellCtrls crashing program? #71086
    Lasse
    Participant

    Embarcadero\Studio\22.0\source\rtl\common\System.ZLib.pas, Line 2850.

    You need your own fork for it.

    Attachments:
    You must be logged in to view attached files.
    in reply to: TsDateEdit date format #71082
    Lasse
    Participant

    FormatSettings is a global variable. So, you can also set FormatSettings.ShortDateFormat. GetFormatSettings resets all date and number format variables to their initial values.

    • This reply was modified 1 year, 10 months ago by Lasse.
    • This reply was modified 1 year, 10 months ago by Lasse.
    in reply to: TsDateEdit date format #71081
    Lasse
    Participant

    I see that UpdateFormat is setting the format by calling DefDateFormat function:

    procedure TsCustomDateEdit.UpdateFormat;
    begin
      FDateFormat := DefDateFormat(FourDigitYear);
    end;

    That function is getting the format from default Windows format settings as you can see here:

    function DefDateFormat(NormalYears: Boolean): string;
    var
      Y: ShortString;
    begin
      Y := iff(NormalYears, 'YYYY', 'YY');
      case GetDateOrder({$IFDEF DELPHI_XE}FormatSettings.{$ENDIF}ShortDateFormat) of
        doMDY: Result := 'MM/DD/' + Y;
        doDMY: Result := 'DD/MM/' + Y;
        doYMD: Result := Y + '/MM/DD';
      end
    end;

    So, if you want to use different date format than your Windows settings you need to modify that function or make UpdateFormat virtual (it is protected but not virtual) and inherit the control. You need to also add DateFormat property, it seems to be private.

    TsCustomDateEdit = class(TsCustomComboEdit)
    protected
      procedure UpdateFormat; virtual;
    public 
      property DateFormat: string[10] read FDateFormat write FDateFormat;

    Then you could do your own control like:

    TMyDateEdit = class(TsDateEdit)
    protected
      procedure UpdateFormat; override;
    ...
    
    procedure TMyDateEdit.UpdateFormat;
    begin
      DateFormat := ...
    end;
    in reply to: Sudden exception in acShellCtrls crashing program? #71075
    Lasse
    Participant

    I see there are a lot of Integer casts. All pointer or object references should be casted to NativeInt.

    in reply to: Sudden exception in acShellCtrls crashing program? #71074
    Lasse
    Participant

    That is a Windows feature… So, there must be some 64-bit math issues in AlphaSkins code which are causing it to fail.

    https://learn.microsoft.com/en-us/cpp/build/reference/highentropyva-support-64-bit-aslr?view=msvc-170

    in reply to: Sudden exception in acShellCtrls crashing program? #71072
    Lasse
    Participant

    I am currently using old version of ZLib but I tested that fix for current version of ZLib, suggested by wesson, and it did work too.

    “It can be solved in System.Zlib with the following (line 2752)”

    `if (zresult = Z_STREAM_END) and (FZStream.avail_in > 0) then
    begin
    Dec(FStreamPos, FZStream.avail_in);
    Fstream.Position := FStreamPos;

    FZStream.avail_in := 0;
    end;`

    in reply to: Sudden exception in acShellCtrls crashing program? #71070
    Lasse
    Participant

    Wow, thanks! This solved all issues with 64-bit build with Delphi 11.2. I read about this feature but never thought it would totally mess up everything.

    https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Support_high-entropy_64-bit_ASLR

    Sure, there still is the ZLib issue but it can be fixed.

    in reply to: Reay = problem? #71061
    Lasse
    Participant

    I think I had the same issue. I have done it this way:

    TMainForm = class(...
      ApplicationEvents: TApplicationEvents;
      TrayIcon: TTrayIcon;
      procedure ApplicationEventsMinimize(Sender: TObject);
      procedure TrayIconClick(Sender: TObject);
      procedure WMWindowStateNormal(var AMessage: TMessage); message WM_WINDOW_STATE_NORMAL;
      ...
    private
      procedure MinimizeToSystemTray;
    end;
    
    procedure TMainForm.ApplicationEventsMinimize(Sender: TObject);
    begin
      MinimizeToSystemTray;
    end;
    
    procedure TMainForm.MinimizeToSystemTray;
    begin
      if OptionsContainer.MinimizeToSystemTray then
      begin
        Hide;
        WindowState := wsMinimized;
        TrayIcon.Visible := True;
        TrayIcon.Animate := True;
      end;
    end;
    
    procedure TMainForm.TrayIconClick(Sender: TObject);
    begin
      TrayIcon.Visible := False;
      Show;
      WindowState := wsNormal;
      Application.BringToFront;
    end;
    
    procedure TMainForm.WMWindowStateNormal(var AMessage: TMessage);
    begin
      TrayIconClick(Self);
    end;
    in reply to: ACCESS VIOLATION in Delphi 11.2 #71060
    Lasse
    Participant
    in reply to: Access Violation Delphi5 #71056
    Lasse
    Participant

    Have you tried sInputQuery from sDialogs.pas?

    in reply to: There is a problem with 200% zoom of 4K resolution #71052
    Lasse
    Participant

    Well, that didn’t work like it should. I changed it to…

    function TacDialogWnd.FixedFrame: integer;
    begin
      if Screen.PixelsPerInch <> 96 then
        Result := ac_GetSysMetrics(SM_CXPADDEDBORDER, GetWndPPI(CtrlHandle))
      else
        Result := ac_GetSysMetrics(SM_CXFIXEDFRAME, GetWndPPI(CtrlHandle));
    end;
    in reply to: Delphi 11.2 64-bit Crashing #71035
    Lasse
    Participant

    I think it is a flaw in skin package. Unfortunately there isn’t a source for Skin editor.

Viewing 20 posts - 41 through 60 (of 205 total)