Jump to content

Cristian Peța

Members
  • Content Count

    329
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Cristian Peța


  1. 11 minutes ago, A.M. Hoornweg said:

    "Take control on entry and restore on exit" would be very cumbersome in the case of DLL's written in Delphi.  It would need to be done in every exposed function / method.

    procedure Foo; stdcall;
    begin
      SetFPCR;
      ...
      RestoreFPCR;
    end;

    Do you think is so cumbersome to do this for every exposed function?

    The SetFPCR and RestoreFPCR you need to write for yourself but only once.


  2. Here something on this them:

    https://stackoverflow.com/questions/77764786/remove-runfulltrust-capability-from-flutter-windows-application

     

    And Win32 apps packaged as msix will need runFullTrust. You can avoid runFullTrust with UWP but a Delphi app will call all sort of Win32 API that will need runFullTrust.

    Quote

    Apps using the FullTrust entrypoint can call any API they want. Usually this is your main Win32/.Net executable. I’ll refer to these applications as FullTrust apps.

    https://blogs.windows.com/windowsdeveloper/2017/07/06/calling-winrt-components-win32-process-via-desktop-bridge/


  3. 43 minutes ago, David Schwartz said:

    So what DO you do in a case where, say, you might use an object to collect an accumulation of data that is provided by multiple sources? 

     

    It's often done for contextual state management over time...

     

    The sources must register to the collector. And unregister when the source does not need the collector anymore.

    The collector must not be destroyed if there is an active source.

     

    This is a little like ARC for interfaces work.

    • Like 1

  4. On 3/22/2024 at 7:22 PM, david_navigator said:

    I was hoping there was something that the OS could deal with.

     

    29 minutes ago, david_navigator said:

    @Kas Ob. could you explain in a little more detail about the memory manager please ? 

    The OS will free the memory when you unload the dll.


  5. 16 hours ago, gioma said:

    in reality that data can be a UTF8 string or a UNICODE string or a file.
    The first character of the data tells me what type of data I have to work with.

    Then you don't know if that first char is one or two bytes.

    You test first byte (suppose UTF-8) and if it is not what you expected then you test first two bytes?


  6. 4 minutes ago, Morphumax said:

    Delphi. I just tried to copy the parameters specified in the hint box. There were quite a few. 

    Maybe I am from ice age and Delphi evolved since then...  but this does not compile in D11.3: E2005 'Create' is not a type identifier

    Calling TGUIDHelper.Create() in procedure declaration where you need to give a type is somehow strange for me.

     

     


  7. 20 minutes ago, Morphumax said:

    procedure HandleCommand(Sender: TObject; aLine: TncLine; aCmd: Integer; aData: TGUIDHelper.Create(System.TArray<System.Byte>, System.Types.TEndian).:1<Byte>, aRequiresResult: Boolean; aSenderComponent: string; aReceiverComponent: string);

    aData type is terrible... is this Delphi code?


  8. 17 hours ago, emileverh said:

    I know it's a compiler problem, but why can they do it with classes and not with records.... 

    It's not a compiler problem, but record variables are not class variables and when you declare a record variable it is allocated automatically.

    You enter into a infinite loop of circular allocation.

    type
      TRecA = record;
      TRecB = record
        FieldA: TRecA;
      end;
      TRecA = record
        FieldB: TRecB;
      end;
      
    var
      a: TRecA; //infinite circular allocation of memory

     


  9. @weabow TFDPhysSQLiteDriverLink is in FireDAC.Phys.SQLite.pas

    But if you copy-paste from here it won't work because after last "k" character there are some non-visible chars: EF BB BF EF BB BF                                                                            

     

×