Jump to content

David Heffernan

Members
  • Content Count

    3701
  • Joined

  • Last visited

  • Days Won

    185

Everything posted by David Heffernan

  1. David Heffernan

    Accessing the memory of a Python List

    If you want to work with numpy, and minimise copying, then you create a numpy ndarray array object and use the buffer protocol to gain access to the object's internal buffer. Do all your work in Delphi using that internal buffer.
  2. David Heffernan

    Reading fields with different lenghts

    If the fields are at known, fixed positions then you can read them directly. If not then you need to parse the data.
  3. David Heffernan

    IOTAProcess.ReadProcessMemory / .WriteProcessMemory

    Seems unlikely. The winapi functions return a BOOL and call SetLastError. HRESULT seems very implausible.
  4. David Heffernan

    IOTAProcess.ReadProcessMemory / .WriteProcessMemory

    That's called returning a value through a parameter. If you look at this function, what else could these integer return values hold?
  5. David Heffernan

    function reference feature for Delphi source code

    By output I mean what is produced by the compiler.
  6. David Heffernan

    function reference feature for Delphi source code

    I don't think so. I think that you don't seem to understand the requirement. You certainly can't achieve the functionality shown in the original post from a native executable file (like the ones that Delphi produce).
  7. David Heffernan

    function reference feature for Delphi source code

    A map file doesn't list functions calls. You can't map the graph of function calls from a map file. Parsing isn't enough. You also need to interpret the tokens that the parser emits, using the syntax of the language. For sure you need a parser. But it's not enough. You need more.
  8. David Heffernan

    function reference feature for Delphi source code

    No. You need way more than a map file to find all the incoming references to a function. This won't tell you the information either.
  9. David Heffernan

    function reference feature for Delphi source code

    grep is useless for this purpose. This functionality in VS works because the tooling is able to compile the code and understand all the references from the output of that compilation. A naive text match using grep will give nothing whatsoever of value.
  10. David Heffernan

    Common callback functions, or not?

    No. That makes no sense. Anonymous methods are just procedural types with variable capture.
  11. David Heffernan

    Using the New Edge browser control

    How would RAM be wasted?
  12. David Heffernan

    IPropertyStore

    You don't need to call Release in Delphi code. The compiler manages that for you.
  13. Absolutely not. Some UInt64 values can never be returned and the performance will be poor.
  14. What will it take for Delphi programmers to give up on the idea that strings and byte arrays are the same thing!
  15. Random returns 32 bits of randomness, why only use 16 of them? In other words, can't you do this with two calls to Random rather than four. Furthermore, Random is a pretty low grade PRNG. Depending on what you intend to use this for, you may want to use a better PRNG.
  16. These helpers are often just copied from .net, and .net strings are immutable. Here is the .net property: https://docs.microsoft.com/en-us/dotnet/api/system.string.chars?view=netcore-3.1
  17. David Heffernan

    Call a D7 dll from C#

    What calling convention is the function? If it is register then that is a problem. Make sure it is stdcall. A websearch for pinvoke will tell you how to call this function.
  18. David Heffernan

    Range checking in library code?

    Conceptually a list class is the same as an array. For sure it has extra convenience functionality, but it is still a random access array. So my philosophy is that consistency is achieved by having lists match arrays. I'd have the range checks conditional on RANGECHECKS. Indeed that is how I do it in my personal collection library.
  19. David Heffernan

    IFileOperation recursion happens when set not to

    You have to enumerate all the files and copy them. Put these files into a double null terminated list. COM should not be initialised here. It needs to be initialised by the owner of the thread.
  20. David Heffernan

    What is the best way to split off a new project?

    I have a unit with 53kloc (hangs head in shame)
  21. David Heffernan

    What is the best way to split off a new project?

    This is a branch or a fork in your SCM system. If you aren't using SCM then that's your problem right there. Solve that problem first.
  22. David Heffernan

    Organizing enums

    Don't think so https://en.cppreference.com/w/cpp/language/enum
  23. David Heffernan

    Organizing enums

    That's what scoped enums are meant for
  24. David Heffernan

    Organizing enums

    This is exactly the issue that scoped enums solves already.
  25. David Heffernan

    Organizing enums

    That's XE7. It seems to me to be folly to design your code based on an IDE tooling issue, and especially one which is soon to be resolved. Further, the issue at stake here, as always when coding, is far less about the experience when writing code, as the experience when reading code. It's not worth it to reduce the readability of your code to give a minor easing to your experience when entering the code.
×