Jump to content

corneliusdavid

Members
  • Content Count

    417
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by corneliusdavid


  1. Lots of different reasons why downloads or installs fail (internet, disk errors, network, anti-virus, etc). I downloaded both the .iso and the .exe (web install) onto two different computers. The .iso failed to mount on one of them so I used the web install; the .iso worked fine on a different one. All just depends on the particular arrangement of bits in the ether on a particular day, I guess!


  2. Thinking about the original question here a little more, I think the problem might be related to the OS:

    On 3/14/2022 at 2:35 AM, RonaldK said:

    Windows Server 2019

    I think most developers run Delphi on Windows 10, which would have all the libraries a typical Windows user would need for a variety of applications. But Windows Server is not an end-user operating system so leaves many things out. It may be that a manual install of .NET or related libraries/tools may need to be done in order for Delphi to work properly on Windows Server.


  3. I find refactoring often broken in that it doesn't work but it (to my knowledge) has never crashed Delphi. Out of curiosity, I moved the "refactoride280.bpl" value to a different key, restarted Delphi, and refactoring was no longer in the menu.

     

    Theoretically, that's one .NET package out. However, I noticed there's another one named, "dotnetcoreide280.bpl." That's obviously got something to do with .NET. I tried removing that and now compiling a small cross-platform app in Delphi 11.1 gives me the error, "Object reference not set to an instance of an object." I put the registry key back and it compiles fine.


  4. 4 hours ago, Fr0sT.Brutal said:

    This is good but requires an account for each user. Moreover, in theory there could be some settings that affect pre-connect state

    This is getting off-topic but... I never use the database-level account feature but use one application-level account to connect to the database then provide a login that checks against a user record for authentication. So if your application is built to require database account credentials before connecting, then you're right, the approach I suggested would not work.


  5. 11 minutes ago, Renate Schaaf said:

    I'm doing that, unless I'm too dim to notice

    Create/Free are the calls that allocated/deallocate the memory for an object, an instance of TDoSomething in this case. In your original code, the call to Create in Button1Click but the Free happens in a procedure of TDoSomething--that's where the difference in context is.

     

    12 minutes ago, Renate Schaaf said:

    I just wanted to understand why it doesn't blow up in my face

    The only reason it didn't blow up is because you don't reference the object (the DoSomething var) after the call to Free. Look at my first example code above where I point out where an ERROR could occur--that's what COULD have happened to you.


  6. I don't think I've ever seen a procedure of a class free the instance of the class it's being called from. Everything in me is screaming DON'T DO IT!

     

    This is very bad practice. The object code may still be in memory after the call to Free but it's no longer dedicated to that object and if, per chance, some other operation suddenly uses that available memory, you've got an access violation.

     

    And to make an example that shows the problem of the dangling pointer @Attila Kovacspoint out:

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      var
        DoSomething: TDoSomething := TDoSomething.create;
    
      DoSomething.DoSomething;
    
      if Assigned(DoSomething) then begin
        ShowMessage('DoSomething Freed but dangling reference still exists');
        DoSomething.DoSomething; // <--- ERROR!
      end;
    end;

    It's better to free the memory outside of the class itself in a try-finally block:

    procedure TDoSomething.DoSomething;
    begin
      ShowMessage('Doing something');
    end;
    
    procedure TForm1.Button2Click(Sender: TObject);
    begin
      var
        DoSomething: TDoSomething;
    
      DoSomething := TDoSomething.create;
      try
        DoSomething.DoSomething;
      finally
        DoSomething.Free;
      end;
    end;

    This makes it obvious from the calling procedure (the button click event) that the object is freed which lessens the likelihood of using it again because it's right there in the procedure instead of hidden in the class itself.

    • Like 2

  7. There's no one perfect way that everyone should use. Personally, I use two different approaches:

    • If a program uses a database, I keep all the configuration settings in there except for the path/server/port of what is needed to connect to the database and those are set in an .INI file in the same folder as the application during installation. The installer has admin rights so it can create files under Program Files, and the database settings should never be changed--except by an administrator. In this case the INI filename is simply:
      ChangeFileExt(Application.ExeFilename, '.INI')

       

    • If a program doesn't use a database and has several options to configure when the program is in use by regular users, the INI filename is:
        FAppDataPath := TPath.Combine(TPath.GetPublicPath, ChangeFileExt(ExtractFileName(Application.ExeName), EmptyStr));
        ForceDirectories(FAppDataPath);
        FAppConfigFilename := TPath.Combine(FAppDataPath, ChangeFileExt(ExtractFileName(Application.ExeName), '.ini'));

      This puts the file in a folder under %ProgramData%\MyApp making it global for any users on the computer.

    • Like 1

  8. I'm a relatively new MVP and have been reading this thread without saying much (partly because I've been away from the computer and partly because I'm new and just listening). The title, at least in my case, was awarded in recognition for what I already do--support the Delphi community. I have been the coordinator for the Oregon Delphi User Group for many years and have been keeping it active. I was also blogging once in a while and was in the middle of writing a book about Delphi. There aren't many hard-and-fast requirements, just keep doing what I'm already doing but maybe a little more frequently; I'm also encouraged to help with beta testing and support forums such as this which I do as I'm able. Yes, we're supposed to be cheerleaders, and I'm happy to do--that but I don't do it blindly and I don't consider myself a paid shrill. 

     

    I know there are problems with Delphi--I've encountered access violations, refactoring doesn't always work, I miss the Parnassus plugins, etc. There are problems in virtually every piece of software under the sun and if you visit forums for other products, even Microsoft tools, you'll find complaints and frustrations aired there as well (I've read horror stories about trying to develop cross-platform .NET apps with Xamarin; and did you ever write a major app in Visual BASIC then want to upgrade to the latest version?  Good luck!). Perhaps there are an inordinate number of major flaws with Delphi but I still seem to be productive--and positive. Maybe it's because I don't do much with high DPI yet or haven't encountered major debugger flaws or some of the other things mentioned as deal-breakers for people--I don't have good answers for them.

     

    I do find discussing work-arounds, reporting bugs, and voting for the issues important to me, and yes, talking positively about the features of Delphi or products from Idera and Embarcadero I find really cool, to be much less stressful. I don't profess to know what goes on behind the scenes of Embarcadero but I've worked for enough companies to know corporate decisions often are the cause for features released too early, yet policy heavily restricts what can be said--and that's often very, very little.

     

    So I agree that we need to keep discussing the issues and keep reporting/voting for issues on Quality Portal but I hope my humble perspective is helpful to someone.

     

    Oh, and for the record, I have a paid Enterprise subscription.

    • Like 4

  9. 1 minute ago, Remy Lebeau said:

    if you don't specify a full path then it will use the Windows folder, not the calling process' working directory

    Oh, that's right--I forgot about that! I often prepend the filename with the application's path in which case the above scenario I described happens.


  10. There are lots of other good suggestions here but I'll just add one thing to check. By default, Delphi projects set their Output directory to .\$(Platform)\$(Config) meaning that while your project (and possibly your .INI file) are in a folder like \MyProject, the .EXE would be in \MyProject\Win32\Debug (for a Win32 app compiled with the Debug configuration). When it runs, it's running from \MyProject\Win32\Debug and therefore doesn't see the .INI file two folders up. When you specified the full path, it likely saved it (as @Attila Kovacspointed out) so that next time it ran, it found the second copy of the .INI file.

     

    This has caught me a few times and now I always check the project's Output directory setting. The possible reason you haven't seen this before is either you had set the Output directory (and forgot about it) or you were using a much earlier version of Delphi (before multiple platforms) that left .EXEs in the same folder as the project.


  11. 4 hours ago, Stéphane Wierzbicki said:

    Thanks but it would be nice if Embarcadero could provide detailed information such as URLs to allow, public IP adresses, TCP / UDP ports ranges and so on.

    There's really nothing more than the standard web ports I mentioned earlier. You can run the IDE to build apps without internet connection. Today's modern software is delivered over the internet so it's to be expected that you'd need an internet connection for installation, updates, and to get add-on styles and libraries through GetIt (which uses a REST API over HTTPS). But after that, I can't think of any special ports or addresses required for normal use of the Delphi IDE.

     

    If you could please list specific error messages you're seeing, that would help.


  12. 1 hour ago, Tom F said:

    What path?

    Sorry, I wasn't clear: Those folders are added to the Windows System Path (outside of Delphi).

     

    And after the standard install, Delphi's Library Path should contain:

    • $(BDSCOMMONDIR)\Dcp
    • $(BDSCOMMONDIR)\Dcp\$(Platform)

    After JCL/JVCL is installed, the Delphi Library Path should additionally contain:

    • <base jcl install path>\jcl\jcl\lib\d28\win32
    • <base jcl install path>\jcl\jcl\source\include
    • <base jcl install path>\jvcl\jvcl\lib\D28\win32
    • <base jcl install path>\jvcl\jvcl\common
    • <base jcl install path>\jvcl\jvcl\Resources

    for Win32 development; equivalent ones for Win64 development.

     

    Several source folders were added to Delphi's Browsing path as well:

    • <base jcl install path>\jcl\jcl\source\common
    • <base jcl install path>\jcl\jcl\source\windows
    • <base jcl install path>\jcl\jcl\source\vcl
    • <base jcl install path>\jvcl\jvcl\common
    • <base jcl install path>\jvcl\jvcl\run

    Hope this helps.

    • Like 1
    • Thanks 1

  13. This isn't an official answer and I don't know how helpful this will be but I looked at the Windows Firewall settings on a virtual machine where I use both Delphi 10.4 and Delphi 11.1 and didn't see any specific ports open but several applications that are allowed for in-bound communication:

    DelphiPortsIn.thumb.png.d4a451a365af442002da75f2b5458240.png

     

    So, only for remote debugging or RAD Server. If anything, it's likely using the standard port 80 (HTTP) or 443 (HTTPS) for outbound calls but you should be able to use it without an internet connection after the initial license verification.

    • Thanks 1

  14. I installed JCL/JVCL after pulling the latest from GitHub and running the supplied install batch files--and it installed fine.

    If you installed D11 into the default folder, you should have four folders added to your path:

    • C:\Program Files (x86)\Embarcadero\Studio\22.0\bin
    • C:\Program Files (x86)\Embarcadero\Studio\22.0\bin64\
    • C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl
    • C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\Win64

  15. On 3/7/2022 at 6:16 PM, CyberPeter said:

    All this nonsense would not be necessary if they would just COMMUNICATE about the issues (docwiki for instance).  The silence only feeds the idea of a failing company or at least a failing product

    I totally agree. It frustrates me to no end to see and hear about problems in the product but not have any response or idea when they'll get resolved, if a feature is dropped, what the priority is, or ANYTHING. Just someone saying, "sorry it's late, we're working on it but are slammed" or something would be better than silence. So often, I see businesses just trying to pretend everything is OK when customers are clamoring for answers. I always give my customers reasons for being late, even if they've heard them before--they appreciate knowing I'm still alive and are listening to their cries.

    • Like 4

  16. 5 hours ago, Tom F said:

    Do I take the risk and download it?

    This isn't a "new" version (like 10.4 Sydney over 10.3 Rio), this is an in-place, dot-release update to 11 Alexandria. Yes, it uninstalls your current version 11.0 installation (if you installed it).

     

    Strange that the numbering scheme is a little different than the 10.x series (e.g. 10.1 Berlin and 10.0 Seattle).


  17. Try putting a TLayer3D on the cube (as a child object) and then adding a TLabel to that. To make the TLayer3D transparent, check Transparency property and make sure the Fill.Kind property is set to None (sometimes you have to toggle that to Solid and then back to None to get it realize it really should be transparent).

×