Jump to content

DelphiUdIT

Members
  • Content Count

    777
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by DelphiUdIT

  1. Some time ago I had a similar problem with RESOURCESTRING, both in overwriting (with the VirtualProtect function) and with LOADRESSTRING in multithreading. Since that time I have created a unit in which I perform all the functions of loading the resources and their eventual overwriting by calling it at the end of the initialization of all the other modules, and since then I have not had more problems. I mainly use the function for translation purposes.
  2. DelphiUdIT

    IDE it's not working anymore

    I don't know if this will help, but in the "KNOW ISSUE OF THIS UPDATE" (link to Microsoft KB of the last Update: Win 10 last update ). They talk about problems with applications that use "certain" audio devices. Bye
  3. My mistake. This is the correct code: function cntCaseTbl(Z: Int64): Int64; begin Result := 0; //This should be, otherwise the result will be random value if z > 0 then Result := Trunc(Log10(z))+1; else if z = 0 then Result := 1; end;
  4. I have tried all limit values 1, 10, 100, 1000, 10000, ....., 9, 99, 999, 9999, 99999, ...... And all the returned values are correct.
  5. May be you can write the function in this way ? function cntCaseTbl(Z: Int64): Int64; begin if z >= 0 then Result := Trunc(Log10(z))+1; else Result := 0; //This should be, otherwise the result will be random value end;
  6. DelphiUdIT

    Windows XP App

    If you are FTDI chips in use you have only one way to work on XP: you must use the VCP drivers of FTDI (Virtual Com Port) that simulates the standard Windows com serial port. The drivers should be signed with version prior 2.12.24 !!! You'll find the drivers for XP in this page: All VCP FTDI drivers version for all version of SO Of course you can use the driver on XP if the FT4232 chip is supported ..... In your TCOMPort component use COMx, I mean the COM port listed in the device manager of windows. Hope this help. Bye
  7. DelphiUdIT

    Windows XP App

    Of course, he MUST have "grep" ... he has Delphi 10.4
  8. DelphiUdIT

    Windows XP App

    That function is called for example by the library used with FTDI USB to RS232 / RS485 peripherals. If someone has integrated FTDI peripheral functionality as a COM (serial) component that function may be called. But from what I know, the drivers for those devices no longer load in XP. The serial devices of the FTDI are in very common use.
  9. Remember that in the new Intel hybrid architectures (such as Alder Lake) not all cores are usable, or rather not all cores have the same processing "power" (eg. P-Core and E-Core).
  10. Look at this code and run it (VCL Applicaton with a Form, a Button with OnClick Event and a custom class) unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TDoSomething = class Danger: string; constructor create; function Ghost: boolean; end; type { TForm1 } TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private public end; var Form1: TForm1; DoSomething: TDoSomething; implementation {$R *.dfm} constructor TDoSomething.create; begin //FROM HERE I NEVER GO THERE .... AND IF I GO THERE BY WRONG, CLOSE THE PROGRAM !!! ExitProcess(0); end; function TDoSomething.Ghost: boolean; begin try result := true; ShowMessage('Here I am, I am a ghost'); except result := false; end; end; procedure TForm1.Button1Click(Sender: TObject); begin if DoSomething.Ghost then //<------- DoSomething is NIL !! ShowMessage('OK, executed') else ShowMessage('KO, some errors append'); end; end. The class is not instantiated, but the GHOST function is executed. Am I missing something? I trust in my abysmal ignorance, because otherwise much more than a certainty collapses ... In tens of years of programming I have never dared to write anything like this, taking some concepts for granted. Aside from the fact that the program doesn't make much sense (good programming rules would also like a "if Assigned(DoSomething) then" before using it), such code cannot run ... at runtime I would expect an error. Hope someone can explain this. Bye
  11. @Dalija Thanks for your article. You have cleared up more than a few doubts.
  12. This is new to me ... a non-instantiated object that "executes" a method .... Yes, of course an exception is thrown: it must be like this because a string needs to have memory allocated. Anyway, thanks for the explanation. I thought that without an "instance" a method could not be executed, or rather that an exception was thrown. You never stop learning. <---- I mean I never stop learning (EDIT) Bye
  13. In general, when I create a new class, a new feature or other, I always think about the possibility that the class is derived (inheritance, polymorphism) and therefore writing a code like the one indicated I would not write it even if it were possible without side effects. Bye
  14. In the latest daily repository available (today 02/21/2022), compiling for Linux64 there are two "probable" bugs: 1) In the file OverbyetIcsSslX509certs.pas on line 1836 the definition of the TMsCertTools class is missing. Solved like this: {$ IFDEF MSWINDOWS} FNewSslCert: = TMsCertTools.Create (self); {V8.67 was TSslCertTools} {$ ELSE} FNewSslCert: = TSSlCertTools.Create (self); {$ ENDIF} 2) In the file OverbyteIcsMailQueue.pas on line 2182 the definition of SetEndofFile is missing (in Linux it does not exist), replaced as follows: {$ IFDEF MSWINDOWS} SetEndOfFile (FHandle); // truncate file size {$ ELSE} ftruncate (FHandle, Count); // truncate file size {$ ENDIF} Inserted in the uses the unit Posix.UniStd Changes not tested yet, but the build is done. PS: I will send you a postcard as soon as possible Bye
  15. DelphiUdIT

    Bug - Linux 64 Compiled

    Sorry, I didn't realize the question was for me ... No, I only compiled for Linux. I wanted to see if everything was standing with Linux because I should start with a project with which the ICS components would suit me. But I haven't done anything yet "run" ... I don't know when I'll start, and I'm not a master in Linux programming. Bye
  16. DelphiUdIT

    Bug - Linux 64 Compiled

    Ok, take care about the new line inserted "ftruncate (FHandle, Count)": It may be that the line is also "ftruncate (FHandle, FLen)", I don't know which of the two variables is correct to be used.. {$ IFDEF MSWINDOWS} SetEndOfFile (FHandle); // truncate file size {$ ELSE} ftruncate (FHandle, Count); // <- ftruncate (FHandle, FLen); ???? {$ ENDIF} Bye
  17. You can create applications of various types, each with its own characteristics: - a Windows service, this is an application with no user interface that runs as a service; - a console application, also an application without a graphical interface, runs on the command line. All these have the access point in the .dpr file, but the path develops in a different way than in a graphic application (typically with a Form). Bye
  18. DelphiUdIT

    enable/disable the internet connection?

    I think the arguments we are discussing are a bit confusing: the title of the topic was "enable / disable the internet connection" and not how, why and when to update Windows. Now we are talking about all but nothing .... Bye
  19. DelphiUdIT

    enable/disable the internet connection?

    With that policy, the automatic update is not operational. It can be done manually. Function on versions of Windows 10 Professional and above, does not work on Windows 10 Home, at least on the latest releases.
  20. DelphiUdIT

    enable/disable the internet connection?

    There is another solution, use the 'route' shell command to temporarily change the gateway and isolate the PC. Other ways I doubt there are without a dedicated driver (network filter). TCP packets, and worse still UDP packets, cannot be filtered at the user level without a system filter. Bye
  21. DelphiUdIT

    Rest in peace dear Danny Thorpe

    RIP, one of the geniuses who created Delphi, VCL, Kylix. Truly an immense loss.
  22. DelphiUdIT

    How do *you* test ?

    I normally derive new code from existing projects. Basically I have a production of very similar projects. When instead I restart from a whole new project, I initially build a mini graphical interface with minimal functionality. Then the core of the project with the various modules. I normally focus on a functional group of methods that I test as I build them both in terms of performance (execution times with variations, possible bottlenecks) and erroneous results. I always use High, Low HighBound, Count, ..... and never numeric expressions to access the indexed data, therefore errors for "out of bound" accesses are normally never present. Compilations and builds are done very frequently. After I have a stable core, I move on to the UI part ... which is the longest and most laborious part normally. Of course at the start of the project the use of some PAPER and some brainstorm is fundamental. The tests are done frequently, it is true that perhaps the development time is longer, but in the end the results are almost always OK, without the need for major modifications
  23. I came across this page by chance which I think is relevant to the topic in question: https://www.ibm.com/support/pages/genuuid-can-generate-more-random-uuid Bye
  24. DelphiUdIT

    how to cosume grpc in delphi vcl client?

    May be this can help you: Delphi port for GRPC Bye
  25. DelphiUdIT

    How to Get Android Phone Battery Percentage in Delphi 10.4

    Look at https://titanwolf.org/Network/Articles/Article?AID=24615291-66fa-41b6-a245-e98230db0210#gsc.tab=0 I try to assemble it and is working. I cannot try in Andorid system now. Hope is working. EDIT: I was able to test it with an Android 11 phone and it works flawlessly. Bye
×