Jump to content

JonRobertson

Members
  • Content Count

    171
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by JonRobertson


  1. Either the error you posted is not a true copy of the error message or something is wrong in your DPROJ. There are no "vcl.dcp.vcl.*" files in the Releases folder or any other folder under Embarcadero\Studio\...

     

    My suspicion is that you are building a project for 64-bit and the compiler is finding a DCU previously built for 32-bit. If the unit's source has not changed, the compiler will not rebuild the DCU even though the DCU was built for a different platform. I wish the compiler dealt with this better.

     

    The first thing to try is Project->Build (Alt-P then B, or Shift-F9 should also work).

     

    If you still get a similar error, post the error message again and your DPROJ file, if possible.


  2. 12 hours ago, Die Holländer said:

    procedure Encrypt(sr: PAnsiChar; key: PAnsiChar; var encryptedText: PAnsiChar); stdcall; external 'YourDLLName.dll';

    procedure Decrypt(sr: PAnsiChar; key: PAnsiChar; var decryptedText: PAnsiChar); stdcall; external 'YourDLLName.dll';

    That would work for a DLL that contains native code and uses ANSI char based null-terminated strings.

     

    The code posted is C# code, using a .NET System.String class "Representing text as a sequence of UTF-16 code units"

     

    The DLL generated will be a .NET assembly containing managed code, not native code. As Peter mentioned earlier, either the DLL has to be written & compiled to support COM interop

    https://blogs.embarcadero.com/using-a-net-assembly-via-com-in-delphi/

    https://www.blong.com/Conferences/BorCon2004/Interop2/COMNetInterop.htm#CCW

     

    or the Delphi application that loads the DLL has to host the CLR before the DLL is loaded.

    https://stackoverflow.com/questions/2048540/hosting-clr-in-delphi-with-without-jcl-example

    https://stackoverflow.com/questions/258875/hosting-the-net-runtime-in-a-delphi-program

    https://en.delphipraxis.net/topic/1744-net-runtime-library-for-delphi/

    https://adamjohnston.me/delphi-dotnet-interop-with-jvcl/

     

    "Explain step by step" isn't possible, as there are a lot of factors to consider. I suspect this is why there are commercial libraries that do this.

    https://www.remobjects.com/hydra/

    https://www.crystalnet-tech.com/

    https://www.atozed.com/crosstalk/

    There was a library called Managed-VCL, which can be found online. But the website vanished a while back.

     


  3. On 4/24/2024 at 4:10 AM, Alexander Sviridenkov said:

    Release is expected in May and will be included in HTML Library bundle

    You have a couple of "bundles". Do you mean the three library bundle?

    Quote

    Bundle (HTML Component Library + HTML Editor Library + HTML Report Library)

    I'm curious as a potential customer.


  4. 1 minute ago, David Heffernan said:

    This is a strange post. The issue with multiple languages is the mix of zero based and one based indexing.

    Different languages have different rules and syntax. Is that really an issue?

     

    I see the "issue" as developers using the incorrect syntax for the language they are currently using.

     

    If I toured Italy, I imagine my trip would be more enjoyable if I spoke Italian. Which I don't. :classic_ohmy:


  5. 15 minutes ago, Lajos Juhász said:

    Also until developers did not start to use multiple languages.

    Should that matter? I started learning Pascal 35 years ago and C the following year. Not once have I written

    c := (a < b) ? a : b;

    or

    if (a == b) { doSomething(); }

    while writing Pascal code.

    • Like 1

  6. 5 minutes ago, Stefan Glienke said:

    Why are Delphi developers so obsessed with doing GUI - I assume most software that operates the world is non-GUI stuff

    I have a lot of respect for your knowledge and experience, seeing some of the work you have done. However, I think that is a fairly bold assumption.

     

    Since 1996, I have preferred Delphi over other development tools/languages/frameworks. I do not enjoy doing GUI work. But I believe a lot of what "operates the world" is line of business apps, whether they be for commerce, government, health care, or hundreds of other industries.

     

    Computers can't read our minds (thankfully). And voice recognition is not that reliable. I see proof of that every time my mother-in-law sends a text. :classic_laugh:


  7. 39 minutes ago, was said:

    it's a pity the docs on TIniFile don't mention the possibility of also editing ,cfg files

    TIniFile will work on any file that conforms to the INI file format, and it seems the RemoteHost.cfg that you have uses the INI file format. But many, if not most, .cfg files will use a different format that isn't compatible with TIniFile.

    • Like 1

  8. 16 hours ago, was said:

    I missed the compiler warning.

    Always pay attention to compiler warnings and hints. Most of the time, the compiler is being helpful. Had you resolved the compiler warning, you would have solved the issue without needing assistance. Asking for assistance isn't a bad thing, that's the beauty of forums like these. But solving issues without assistance is even better, for me anyway. :classic_biggrin:

     

    My opinion is that I am not "finished" with code unless it compiles with zero compiler warnings and hints. Sometimes I even add a statement just so the compiler will be "happy".

     

    I believe that W1036 should be an error rather than a warning, as using an uninitialized variable is almost always a bug in the code. I only say almost because I've learned there are exceptions to every rule.  :classic_wink:

     

    Warnings can be changed to errors at the project level. I have W1036 set to an error in my projects. This is done in project options. See this post if needed: state of an uninitialized variable

     

    6 hours ago, was said:

    I was probably going to use Try/Finally in the code once I had proved the concept

    try/finally should be a habit when any resource is created or allocated, or a state that should be undone, such as setting Screen.Cursor or calling methods such as DisableControls/EnableControls and BeginUpdate/EndUpdate. Once you've developed the habit, you won't even think about doing it. It'll just be natural. And it'll avoid a lot of potential headache.

     

    I neglected to mention it earlier because it was end of day on a Friday and I was ready to leave the office. Oops!


  9. You are likely getting an AV because RHini is not initialized to nil. As a local variable, it has a random value until initialized. You should have a compiler warning:

    [dcc32 Warning] W1036 Variable 'RHini' might not have been initialized

    Change your top line to:

    var RHini: TIniFile := nil;

    or perhaps

    var RHini: TIniFile := TIniFile.Create(AppDir +'\RemoteHost.cfg');

     


  10. 22 minutes ago, Lars Fosdal said:

    If you are a corporate developer, the money for tools are peanuts compare to other costs.

    I completely agree. Unfortunately, people who write the "corporate check" don't always agree.


  11. 2 minutes ago, dummzeuch said:

    Is that part of Uwe's MMX explorer?

    Yes, although more of a helper. Removes the with identifier do [and begin/end statements if present] and copies "identifier." to the clipboard so you can easily paste it where needed.

     

    It does not automatically determine which fields need the "identifier." added. Very simple example:

     

    Before:

      with Form1 do begin
        Left := 200;
        Top := 100;
      end;

    Invoke MMX Convert with:

     

    image.thumb.png.190e0693145aa008ee0d2a2f46bd2f28.png

     

    After:

      Left := 200;
      Top := 100;

    And "Form1." is in the clipboard to be manually pasted where needed.

    • Like 1
    • Thanks 2

  12. 3 minutes ago, dummzeuch said:

    there are actual reasons to use features in Delphi that are frowned upon by some people, even the discouraged goto

    Hopefully not with :classic_rolleyes:

     

    Shift-Alt-W (MMX Convert with statement) is a good friend of mine when "migrating" legacy Delphi code.

    • Like 1

  13. 9 hours ago, David Schwartz said:

    Maybe because details of the trial are irrelevant to the offer itself?

    That is just nonsense in my opinion. Of course the details of a trial are relevant to the trial. Saying otherwise is almost as inconceivable as saying the details of the license agreement are irrelevant to my use of a software product or developer tool.

     

    9 hours ago, David Schwartz said:

    If you put them on the MAIN OFFER PAGE then people will often get the two confused

    What about the page that quite clearly says at the top

    Download AppGini Free Trial

    Or perhaps on the Frequently Asked Questions page, for someone like me that would want to know.


  14. 3 hours ago, David Schwartz said:

    I imagine you prefer visiting projects on GitHub that have no documentation at all and require you to read the code to figure out exactly what they do

    I prefer projects have documentation. But a lack of documentation does not keep me from investigating. Reading the code is the best way to learn what they do.

     

    3 hours ago, David Schwartz said:

    hey, they're free, so what's a few hours of your time worth, right?

    It takes time to learn new things. I find learning to be extremely valuable.

     

    4 hours ago, David Schwartz said:

    I don't understand why so many programmers are allergic to paying for the same stuff that they themselves get paid to do

    If that was directed at me personally, it should not have been. You have no idea how much money I have spent on software or developer's tools since I started learning to program 43 years ago.

     

    I don't understand why a person or company that creates a product they believe would be useful to others wouldn't spent a few minutes to inform potential customers the details, including limitations, of a trial version or offer.


  15. 10 hours ago, David Schwartz said:

    Has anybody played with AppGini from BigProf Software

    Nope, but I clicked the link out of curiosity. I just love commercial products that offer a trial but give no details about the trial period, expiration, or trial limitations.

     

    However, the price sounds very reasonable... if it works :classic_biggrin:


  16. 3 hours ago, mitch.terpak said:

    I once tested GPT4.0 for some assembly code. Its actually quite good at explaining and improving Assembly code, but absolutely horrendous at writing it from scratch.

    GPT and other AI services aren't capable of thinking. They only "know" what has been trained or other resources to use as a reference (ie code online that a human originally wrote). If I wrote some assembly code that I posted online somewhere and GPT used my code as a reference point, any code that GPT generated would blow big time. :classic_wink:

    • Haha 1

  17. 5 minutes ago, Ian Branch said:

    A good idea.  Where/how does one do that?

    Project Options, Building, Delphi Compiler, Hints and Warnings:

     

    image.thumb.png.ffde00f5babfd196830ab614ca8e6bdc.png

     

    Expand "Output warnings" and scroll down to "Variable might not have been initialized". Select the drop down and set it to "Error":

     

    image.thumb.png.d28ca6200ba093e3e86bb82ab32eff8f.png

     

    Note there are *dozens* of warnings that you can change to errors.

     

     

    • Thanks 1
×