Jump to content

David Heffernan

Members
  • Content Count

    3536
  • Joined

  • Last visited

  • Days Won

    175

Posts posted by David Heffernan


  1. 16 minutes ago, Stefan Glienke said:

    Open cmd, type dcc32 it prints (almost) all parameters. You will find the -NS switch for namespace search path.

    So what you do is pass -NSvcl (probably there are some more needed such as Winapi - just take those that a new project in Delphi usually gets)

    That might make it compile, but you'll also need to specify any other options that are non-default.  And then update the code that invokes compilation any time you make a change to the project config being compiled. Why not let msbuild do it for you?


  2. As a programmer, you are aware of the issues around invalid data, missing data, etc. The client who provides the specification is often less aware of these issues, and their consequences.

     

    In terms of ethics, I would say that as a programmer it is your responsibility to raise the issue with the client. That's part of being a good professional. How the client responds to that is down to them. If they insist on ignoring invalid data, then that is their choice. But you should strongly advise them against that, and if they do insist, then document that this was their choice.

     

    In your case it sounds like the ultimate client is not being advised of this, and the culture in your organisation is to do what the client asks without questioning it.  That's a slightly different problem.  If the decision takers in your organisation are not receptive to best professional practise then there's only so much you can do.

    • Like 1
    • Thanks 1

  3. 40 minutes ago, A.M. Hoornweg said:

    Out of interest, which development system would you pick today?

    These decisions depend very heavily on what type of coding you are doing. In my case it's a numerical code, whose bottlenecks are floating point calculations. So runtime performance is highly important, and Delphi is very poor in this regard. 

     

    My working assumption is that C++ would be the right choice, at least for the numerical part of the code. But if and when we come to migrate then I'd need to spend a lot of time evaluating options, and I'd look beyond C++ too.

     

    This is not to say that I am a big fan of C++. 


  4. This __imp_ mangling, IIRC, is used by ms tools when linking using a import lib. Delphi links to DLLs in a different way. Not sure if the difference is important.

     

    If it were me I'd compile each source file individually using cl and then link those.

     

    Although I don't like to do that very much. It's tempting to be able to link objects statically. But it's fraught with difficulties. It's fiddly. And under x64 you have a further problem. The Delphi compiler doesn't respect the meta data in the object file describing the exception tables. So if exceptions are raised in the linked C code, then it's common for the process to be terminated forcefully.

     

    These days I always prefer to link to DLLs using an sxs assembly to avoid problems with dll search paths. 


  5. 20 minutes ago, Lars Fosdal said:

    It doesn't need to be complicated. 

     

    If the type of the variable you reference by with contains a field or property that has the same name as a local field or property - you do not get a hint or a warning, but the property set will be the on the with reference, not on the class instance doing the with reference.

     

    All problems relating to with could be solved by the compiler warning about such collisions. 

    • Like 1

  6. 3 hours ago, Gary Wardell said:

    What should I change so I can get a helpful answer?

    More clarity in the question. Full details of error, and a minimal reproduction. And don't post criticism for not receiving a response immediately. That does not motivate people. 


  7. 8 hours ago, Gary Wardell said:

    Hmm, 23 views and nobody knows what FMX files are or where they are from or how to add them to the library files so they can be found?

    Not sure this approach is helpful. 


  8. 19 minutes ago, Vincent Parrett said:

    My records have constructors, I'm guessing that now makes them managed records

    No I don't think it does make them managed records. 

     

    I don't really understand how such simple code could break the compiler. It's as if Embarcadero don't have comprehensive tests in place. 

    • Like 3
    • Confused 1
×