Jump to content

David Heffernan

Members
  • Content Count

    3710
  • Joined

  • Last visited

  • Days Won

    185

Everything posted by David Heffernan

  1. David Heffernan

    Creating Import Library from DLL (64-Bit)

    https://stackoverflow.com/questions/9360280/how-to-make-a-lib-file-when-have-a-dll-file-and-a-header-file
  2. Of course it makes sense. Try declaring set of TObject and see how that works out. You'd need to constrain to an ordinal type with 256 or fewer elements and you can't do that with constraints. Too bad we can't have templates.
  3. Whilst you can't use constraints, you can use generics and RTTI to get some effective code reuse when working with enums and sets. Ideally this could be done truly generically but such is life with Delphi.
  4. We can't see what the class does. You've just shown the interface.
  5. David Heffernan

    is FMX supported RTL (Right to Left) languages?

    I think the answer is still no.
  6. David Heffernan

    Custom component TAction (s) - OnExecute overide

    I cannot understand what you mean by event in component or instance. In fact I can't make any sense out of this.
  7. David Heffernan

    load from file

    I can't understand the question at all
  8. If you want to fully test your own app this is the way to go, so that you get top down allocation for all the addresses in your program. You won't necessarily find all the issues if you only do the fastmm local allocator. Using OS top down has always worked well for me.
  9. Better is to use OS level top down allocation.
  10. Nothing here is "as expected". This is all undefined behaviour that is subject to change in future compiler releases. It's a mistake to read the return value before assigning to it.
  11. Delphi strings are managed types so they are never ill-defined in the way that unmanaged types can be before first assignment. Note that this assumes correct practise. So if you use GetMem rather than New to allocate memory for a managed type then the above statement is not correct, but then doing that would be incorrect practise.
  12. David Heffernan

    Range check error with TSysLogServer

    Maybe so. But my point about how to deal with getting a pointer from a string that may be zero length stands. So long as the use of the pointer respects the zero length and doesn't try to de-reference it.
  13. David Heffernan

    Range check error with TSysLogServer

    The correct solution, in my view, is to pass Pointer(RawMessage) rather than @RawMessage [1]
  14. David Heffernan

    access violation vcl260.pbl

    This can easily happen. It's really common. Programming mistake in the app manifests as an exception raised in vcl code. Nothing interesting to see here.
  15. Here's what to do. First of all you need to understand the R code. You need to know what it's purpose is, and how it achieves it. You will need a clear understanding of what data types are expected to be passed to, and returned from the function. You may need to talk to the author of the code, or learn enough R to work it out yourself. Once you have a clear understanding then you will be in a good place to write an equivalent function in Delphi. Good luck.
  16. David Heffernan

    MIGRATING PHOTOBOOK TO DELPHI ALEXANDRIA FROM 2014

    If you comment out all of the code then the library will compile. And we all know that once a piece of code compiles, the job of the programmer is done.
  17. David Heffernan

    Delphi 11.1 Provisioning Access Violation

    Index out of range error. Stack overflow. Invalid operation. Is that how this works?
  18. David Heffernan

    MIGRATING PHOTOBOOK TO DELPHI ALEXANDRIA FROM 2014

    So make the necessary changes. Or hire a programmer.
  19. David Heffernan

    Loading data from dfm

    I can't make any sense of what you are asking here.
  20. David Heffernan

    Tstringgrid grid index out of bounds

    Perhaps the bug is in some other code in the user's program. One of the recurring themes with questions like this is that the asker often doesn't know how to use, or even realise the value, of the debugger. Re-writing the code for them doesn't help them learn that.
  21. David Heffernan

    Tstringgrid grid index out of bounds

    Do you understand what the error message tells you? You are using an index i outside the range 0 to Count-1. You can use your debugger to find out which indexing operation is out if bounds. Debugging by looking at code can be quite hard. Delphi has a powerful debugger for such moments.
  22. David Heffernan

    Micro optimization: IN vs OR vs CASE

    Do you know this?
  23. David Heffernan

    Incompatible types bug in D11.1

    The reason I asked for a minimal reproduction is that by making one, and making it minimal, you'd have learnt a good debugging technique. Instead you posted loads of spurious code. But the act of curltting it down to a minimal reproduction would have led you to the error. Then again, the compiler told you which line the error was on and somehow you missed that information.
  24. David Heffernan

    Incompatible types bug in D11.1

    Can you make a minimal reproduction and post it here as formatted code rather than screenshots.
  25. David Heffernan

    Micro optimization: IN vs OR vs CASE

    What proportion of the overall time your program takes for the task, is the operation you are trying to optimise in this thread?
×