Jump to content

shineworld

Members
  • Content Count

    282
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by shineworld


  1. - Never keep passwords in strings (use raw bytes arrays coding them with hashes).
    - Where possible I use Sentinel HASP Keys and related software protections.

    - Reduce the amount of UI used in DFM (sometimes I prefer to create UI with code).
    - Could help a little to use UPX packer compressor so not GURU can't have simple access to DFM contents with resource viewers.
    - Some tools, as MadExpect, add CRC exe integrity test (you can add system custom system to check exe integrity).
    - Deploy custom exe with final customer info encrypted (so you can know where start the fall).
    - Don't place security checks in only a unit but be creative 🙂


  2. Thanks for the info, very usefull!


    I've already fought a lot (a couple of weeks) with ANSI string used often, in the old 2007 project, as byte storage media (communications, crypt algorithms, data storage, etc).
    The use of string (AnsiString) was fine and simple but now had required a lot of checks and changes to work fine and moved to TByteArray or similar classes.


    The reasons to move the project to Syndey (or Rio, I've also that) are:


    - Memory
    - Unicode support
    - More updated 3rd parties libraries (as well as GLScene, etc).
    - Gestures support

     

    Memory

    I already use FastMM to extend at maximum 32-bit capabilities.
    SynEdit (ansi version) becomes critical when reaches more than 8 million g-code lines (G-Code is the language of CNC).
    With FastMM I can reach more than 15 million g-code lines in the same 32-bit OS.
    OpenGL graphics also eat a lot of memory (internal data of GLSCene).
    With 64 bit available memory should not be a problem to have more memory for the process and threads.

    Also the g-code language compiler is hungry for memory.

    {$INCLUDE Settings.inc}
    
    // TAKE CARE: If in the project there is an uses of IdComponent this add a critical section in initialization section
    //            which will not be delete in finalization code signing for a Critical Section Leak. Don't care about this
    //            leak because is wanted by Indy designers. Follow the note in IdComponent.pas:
    //
    //            initialization
    //              GStackCriticalSection := TCriticalSection.Create;
    //            finalization
    //              // Dont Free. If shutdown is from another Init section, it can cause GPF when stack
    //              // tries to access it. App will kill it off anyways, so just let it leak
    //              // FreeAndNil(GStackCriticalSection);
    
    // Use this CODE-CHUNK to restore automatically removed, by Project -> Add/Remove..., FastMM uses declaration
    //
    // {$IFDEF USES_EMBEDDED_FASTMM_MEMORY_MANAGER}
    //   {$SetPEFlags $20}
    //   {$DEFINE USES_FASTMM}
    //   FastMM4 in 'sources\extra\FastMM4\FastMM4.pas',
    //   FastMM4Messages in 'sources\extra\FastMM4\FastMM4Messages.pas',
    // {$ENDIF}
    uses
    {$IFDEF USES_EMBEDDED_FASTMM_MEMORY_MANAGER}
      {$SetPEFlags $20}
      {$DEFINE USES_FASTMM}
      FastMM4 in 'sources\extra\FastMM4\FastMM4.pas',
      FastMM4Messages in 'sources\extra\FastMM4\FastMM4Messages.pas',
    {$ENDIF}


    Unicode support
    Market increase and need to support not ANSI languages has come.
    I already use dxgettext and .po files (I've modified the gnugettext.pas to work fine with Rio and Sydney).

    More updated 3rd parties libraries (as well as GLScene, etc)
    GLScene is an incredible OpenGL environment and is grown a lot in recent years.

    Unfortunately, the latest compatible version with 2007 is old, very old and missing a lot of interesting things.
    I need to move to it 🙂

    Gesture support
    I would like to fully support the touch screens with gestures management.

     


  3. Thanks for the suggestion,
    I never thought about this option.

    I'm an old Delphi programmer (from the first version) but I've increased in lines code and sometimes I've missed the good code planning.

    At moment I'm trying to port a project from Delphi 2007 to Sydney.

    There are about 1.300.000 code lines a lot of 3th parties libraries (someone to substitute because incompatible with Sydney).

    Just a sample of the project (all native Delphi code here ): 

     


  4. I hereby want to thank all of you for the answers.
    I misunderstood the mechanism of creating and destroying objects in Delphi, especially when forms are destroyed.
    So far the code has worked but only because an unclosed thread changed the cards in play.

    Thank you AGAIN for your time!


  5. Hi all,

    I'm trying to de-couple the actions lists, with related actions,

    from a specific form to a data module.

     

    These actions will be used so also in other views without duplicate them in every form.

     

    The things work BUT they are not cyclic updated.

    The OnActionUpdate is called only when I click on the assigned graphic button (for example),

    but I would like that ActionXXX.Enabled si cyclically called as when they are in a form.

     

    Some ideas?
    Best Regards
    Silverio


  6. You are right, I've checked again with an empty program in BDS2006 and worked as you had suggested.

    But if I debug my big program the behavior is different, so there something that has changed the rules in my code!
    I need to check it...

     

    Thank you for the suggestion about 

     AddExitProc(DoOnExit); // Put this line before Application.Run
     

    I don't know it before...

     


  7. Hi all,

     

    I'm moving a big project, about 1.500.000 code lines from Delphi 2006 to Syndey,

    but I'm in trouble with how Syndey destroys objects in program termination.

     

    Sample:

    A very Dummy application with 1 form without any other code than a comment in TForm3.FormDestory to

    place a breakpoint:

     

    unit Unit3;
    
    interface
    
    uses
      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
      Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
    
    type
      TForm3 = class(TForm)
        procedure FormDestroy(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form3: TForm3;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm3.FormDestroy(Sender: TObject);
    begin  // < placed breakpoint here!!!
      //
    end;
    
    end.

     

    A very simple project with a string assignment to catch the main flow (in S := ''; ) after Application Run:
     

    program Project2;
    
    uses
      Vcl.Forms,
      Unit3 in 'Unit3.pas' {Form3};
    
    {$R *.res}
    
    var
      S: string;
    begin
      S := 'asdfasdf';
    
      Application.Initialize;
      Application.MainFormOnTaskbar := True;
      Application.CreateForm(TForm3, Form3);
      Application.Run;
    
      S := ''; ; << placed break point here
    
    end.

    In BDS 2006 if I run this code and exit program first break at Form3.FormDestroy,

    then breaks in main at S := ''. RIGHT !

    In Sydney first, break in the main at S := '', then goes to Form3.FormDestry.

     

    What has changed so much the Delphi behavior?

    if I add a Form3.DoubleClick event with
    Application.Terminate

    I got also an environment error:

    [50164E97]{rtl270.bpl  } System.Classes.TList.Get (Line 4972, "System.Classes.pas" + 2) + $A
    [50EBFC4B]{vcl270.bpl  } Vcl.AppEvnts.TMultiCaster.GetAppEvents (Line 657, "Vcl.AppEvnts.pas" + 1) + $B
    [50EBF60E]{vcl270.bpl  } Vcl.AppEvnts.TMultiCaster.DoActivate (Line 425, "Vcl.AppEvnts.pas" + 5) + $9
    [50E5A73F]{vcl270.bpl  } Vcl.Forms.TApplication.WndProc (Line 10617, "Vcl.Forms.pas" + 126) + $C
    [50181450]{rtl270.bpl  } System.Classes.StdWndProc (Line 18021, "System.Classes.pas" + 😎 + $0
    [50E5B23F]{vcl270.bpl  } Vcl.Forms.TApplication.ProcessMessage (Line 11028, "Vcl.Forms.pas" + 23) + $1
    [50E5B282]{vcl270.bpl  } Vcl.Forms.TApplication.HandleMessage (Line 11058, "Vcl.Forms.pas" + 1) + $4
    [50E5B5B5]{vcl270.bpl  } Vcl.Forms.TApplication.Run (Line 11196, "Vcl.Forms.pas" + 26) + $3
    [0051E178]{bds.exe     } bds.bds (Line 222, "" + 13) + $2

    😞 

    test.7z

×