Jump to content

David Heffernan

Members
  • Content Count

    3493
  • Joined

  • Last visited

  • Days Won

    172

Everything posted by David Heffernan

  1. David Heffernan

    C# struct to Delphi conversion help

    Show us an example, with modern Delphi. For sure some ancient versions didn't get alignment correct. That's no longer the case. Compiler alignment always works for me, and I do a lot of it. And converting to 64 bit was trivial when I had to do that.
  2. David Heffernan

    C# struct to Delphi conversion help

    In your Delphi code you should be using {$MINENUMSIZE 4} at the point where you define the enums. An example from my own codebase: //Dragon4 {$MINENUMSIZE 4} type TDragon4DigitMode = (DigitMode_Unique, DigitMode_Exact); TDragon4CutoffMode = (CutoffMode_TotalLength, CutoffMode_FractionLength); {$MINENUMSIZE 1} I would however say that using offset methods to compare offsets is very good advice. But I definitely do not advise manual alignment. The compiler can do it perfectly well. You may as well get it to do that. Then, come the day you move to 64 bit, you won't have to change a thing.
  3. David Heffernan

    C# struct to Delphi conversion help

    This is bad advice. If you are using aligned records in Delphi, then the compiler uses the same alignment rules as for aligned C++ structs, and for aligned C# structs.
  4. The things you are discussing now seem unrelated to storing pi in a float. I don't feel as though we understand the problem domain yet.
  5. You can't store pi exactly in a float. What is the motivation for the question?
  6. David Heffernan

    Impossible to find error

    A dfm file is a source file
  7. David Heffernan

    Impossible to find error

    Definitely not impossible to find the error. Search for TDBLookupComboBox in all the .dfm and .pas files that are compiled.
  8. This isn't true. Your class function calls the default constructor and that performs memory allocation. Free must be called. Instances of classes are heap allocated.
  9. David Heffernan

    Please need help for some java lines program to Delphi

    What have you tried so far?
  10. David Heffernan

    Please need help for some java lines program to Delphi

    What specifically do you mean by "help me translate"
  11. David Heffernan

    Remote Delphi developer position

    6 month contract and you have to jump through all these hoops. It's a seller's market right now.
  12. David Heffernan

    Remote Delphi developer position

    Staggering that an employer could post something as demeaning as this.
  13. David Heffernan

    Unable to run 2 TPythonEngine per VCL application

    Next release of Python supports per interpreter GIL which sounds exciting.
  14. David Heffernan

    FileOpen a network file

    Well, there will be an error code. You have to retrieve it.
  15. David Heffernan

    FileOpen a network file

    When you tried this, what happened? What error was reported. Or was there no error reported?
  16. David Heffernan

    FileOpen a network file

  17. David Heffernan

    New Code Signing Certificate Recommendations

    This is precisely what I am doing. My Python build code to perform signing starts like this: def Sign(filename, sdk=None): # see https://medium.com/@joshualipson/ev-code-certificates-automated-builds-for-windows-6100fb8e8be6
  18. David Heffernan

    FileOpen a network file

    It doesn't look like that to me. It looks like a file read for a file named by UNC. I don't think I'd be wanting to use FileOpen anywhere ever. Shouldn't you be using streams these days? Having said that of course, FileOpen still works. You didn't tell us what happened when you used the old code. If you have a problem that you want some help with, then you should say what the problem is. People can't offer solutions to problems that aren't described. Do you understand what \\IP_address\FolderName\Filename is? I trust you do, and that the file specified by this UNC path is available on your current target device. Is it?
  19. David Heffernan

    How to compare performance between Delphi versions?

    For the record this is completely wrong
  20. David Heffernan

    Convert project c# to pascal

    You said a C# project. Anyway, why don't you do this work yourself?
  21. David Heffernan

    Convert project c# to pascal

    That will maybe buy you 30 minutes of a qualified person's time.
  22. David Heffernan

    Convert project c# to pascal

    Hire a programmer
  23. David Heffernan

    Returning a string from a bpl

    That's not quite enough. Do the exe and bpl both link to the same runtime packages?
  24. David Heffernan

    Returning a string from a bpl

    This will work fine so long as everything is linked correctly. No need even to use stdcall. So probably the linkage is messed up. We can't see the entire picture.
  25. To cast to PByte then it's PByte(myPointer)
×