Jump to content

David Heffernan

Members
  • Content Count

    3527
  • Joined

  • Last visited

  • Days Won

    175

Posts posted by David Heffernan


  1. OK, just looked tlat the documentation and it explains it all. You have to delete the sub keys. And you won't get an error in your code because the function returns a boolean indicating success or failure. You didn't check this. 

     

    Let me gently suggest that rather than tearing hair out, the documentation may help!


  2. Delphi is no easier than Java to learn.

     

    Delphi on mobile hasn't had the greatest track record. For instance at the moment there is no 64 bit Android compiler, thus locking delphi out of the app store. Yes there are temporary workarounds but it is not a great situation. 

     

    Embarcadero are struggling to keep pace with developments on the platforms that they attempt to support. 

     

    Quality has historically been a huge problem for Delphi. Both in their various compilers and related tooling, and their library code. They have a track record of releasing products and libraries that are full of bugs, and then spending many releases trying to fix them.

     

    The VCL remains a brilliant piece of work and for native Windows UI development it still excels.

     

    If I were you I'd widen the search. You say that you don't have time to learn a more difficult language. And that you want to start a business on the side. To be honest, those two statements don't sound very compatible. Making a business work takes a huge investment of time. Being a successful programmer demands mastery of tools and language. And that takes time. There are no shortcuts. 

    • Like 7

  3. No, it's using arctan2 rather than arctan.

     

    Just read every single other implementation on that page.

     

    As far as both sumsin and sumcos being very close to 0, I would still advise not using a tolerance.  All you can achieve by that is giving a less inaccurate answer than is possible to reach.

     

    If you want to do better, use one of the algorithms used for dealing with roundoff when calculating sums, for instance Kahan summation.


  4. 34 minutes ago, Mahdi Safsafi said:

    You don't need to convert Program2 into DLL. Just exports your functions and consume them directly from Program1 (just like DLL).

     

    
    // ========================================== Program1 ==========================================
    program Project1;
    {$APPTYPE CONSOLE}
    {$R *.res}
    uses
      System.SysUtils,
      WinApi.Windows;
    const
      Program2 = 'Project2.exe';
    type
      TGetProgram2Result = function(Param1, Param2: Integer): string;
    var
      LIB: HMODULE;
      GetProgram2Result: TGetProgram2Result = nil;
      s: string = '';
    begin
      try
        LIB := LoadLibrary(Program2);
        @GetProgram2Result := GetProcAddress(LIB, 'GetProgram2Result');
        s := GetProgram2Result(5, 2);
        Writeln(s);
        Readln;
      except
        on E: Exception do
          Writeln(E.ClassName, ': ', E.Message);
      end;
    end.
    
    // ========================================== Program2 ==========================================
    program Project2;
    {$APPTYPE CONSOLE}
    {$R *.res}
    uses
      System.SysUtils,
      WinApi.Windows;
    function GetProgram2Result(Param1, Param2: Integer): string;
    begin
      Result := Format('%d+%d=%d', [Param1, Param2, Param1 + Param2]);
    end;
    // ------------- EXPORTS -------------
    exports GetProgram2Result;
    begin
      try
        Writeln('This is Program2');
        Writeln(GetProgram2Result(5, 2));
        Readln;
      except
        on E: Exception do
          Writeln(E.ClassName, ': ', E.Message);
      end;
    end.

     

    Nope, that doesn't work. You can't expect to load an exe file with LoadLibrary. Also, even if you could, don't go exporting string across a module boundary.

     

    I'm astounded at all the posting here for a trivial problem with a standard solution.


  5. Regarding a fix, this is only one of a number of problems with scope resolution in the language.

     

    Same issue arises when you use units, where more recently imported symbols hide those from units imported earlier. Same for local variables and methods. Same for local variables and global symbols. 

     

    Anywhere where you refer to a symbol and there are multiple matches then the compiler chooses the most recent. 

     

    In princple the resolution is simple. Introduce a new compiler warning whenever the compiler uses this most recent principle. 

    • Like 5

  6. Debugging was never the issue. That was just annoying. Refactoring was never the issue either. That also is annoying but one of many broken aspects of the refactoring. 

     

    The issue is the silent bugs that arise when you add a field to a type and that one hides local variables.

     

    This has been discussed hundreds of times. Try some more websearch. 

     

    Then, stop using with. 

    • Like 4

  7. 7 hours ago, msintle said:

    I reported a bug with madSecurity a while back here:

     

    http://forum.madshi.net/viewtopic.php?f=8&t=28726

     

    Unfortunately the issue hasn't been fixed for over two months since the public report.

     

    Privately, he has made it clear that he has no interest in fixing the bug unless he is getting paid for it, which makes it sound like the library is dead to me.

     

    The self-professed "mad" author has moreover censored and edited the title of the post at his forum where I drew attention to the fact that he is no longer maintaining the library.
     

    My company had sponsored the 64-bit version of madSecurity a while back, so we're definitely very taken aback that our investment was misguided.

     

    Are there any alternatives to this library?

     

    Moving forward, we will be moving our code off his platform, and would advise other developers to steer clear of madSecurity which has many subtle bugs and code that is very obtuse.

    In defence of Mathias his madExcept library is superb and very actively maintained. 

     

    And his response to your comments in the thread seem reasonable. Why expect him to work on freeware? Anything he does is a bonus. It looks like your frustration is getting the better of you. 

    • Like 7

  8. There are simply some rules of use for certain types of library that cannot be enforced effectively by the compiler, or even by runtime checks. For these rules you need documentation and developers that are prepared to read documentation. 

     

    My personal view is that if a developer is not prepared to go to the trouble of reading the documentation, then any problems they have are their concern and not that of the library developer. 

×