Jump to content

DelphiUdIT

Members
  • Content Count

    734
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by DelphiUdIT

  1. DelphiUdIT

    Anyone know of an AVIF Image Decoder for Delphi?

    ImageEn https://www.imageen.com/info/ support AVIF format. But is not free. Bye Edit: also you can extract c headers form there https://github.com/AOMediaCodec/libavif and convert to pascal wrappers.
  2. DelphiUdIT

    indy + LDAP

    There is a unit IdLdapV3 (under directory "lib\protocols"). Bye
  3. DelphiUdIT

    Looking for RpShell, RpTable, RpDefine, RpBase, RpSystem

    Fast Report have a converter from Rave file (*.rav) so you can convert the whole project to use it in Delphi 10.4 and Fast Report This is the link: https://www.fast-report.com/en/blog/show/frconverter-console-utility/
  4. This may be a bit OT, but if you want to avoid try .. and maybe even single windows api testing, you can use this feature (I've been using it for years): type TFMain = class(TForm) ....... protected procedure ErroriRunTimeNonGestiti(Sender: TObject; E: Exception); ....... end; procedure TFMain.ErroriRunTimeNonGestiti(Sender: TObject; E: Exception); begin .... do something; end; // In the form create event you can insert: Application.OnException := ErroriRunTimeNonGestiti; //Handle critical system errors (caused by the application) //By default critical errors are handled directly by Windows SetErrorMode(SEM_FAILCRITICALERRORS OR SEM_NOGPFAULTERRORBOX); Obviously this occurs if you don't use the try ... except.ì, i.e. for all the exceptions that your program generates and are not managed by it. The fact that you assume that an allocation error is reported to you by the operating system is misleading: if the memory allocation fails (at least for a string allocation) it is likely that your program will not notice it because it probably "won't run", the operating system will probably have notified you on screen that there is a "lack of resources" and will "hang".
  5. I haven't used FindFile... for many years. To list the files I suggest you to use the functions of the System.IOUtils unit, for example: var FileList1: TStringDynArray begin FileList1 := TDirectory.GetFiles('.\Images\', '*.*', TSearchOption.soAllDirectories); for var ix := Low(FileList1) to High(FileLis1t) do begin //Do Something //This catches the last modified time of the file //TFile.GetLastWriteTime(FileList1[ix]) //You can use the next line to check if the file really exists //FileExists(FileList1[ix])) end; //Clear the list SetLength(FileList1,0); end;
  6. If you want to use the GPU, you can use OPENCL standards. I use OPENCL through some computer vision libraries, but the OPENCL is transparent to my code. I can enable or disable both partial and full OPENCL functionality for the whole library at runtime, so a certain function will be able to run under GPU or CPU without the code being modified. However, with modern processors (I have been using the Intel I7 12xxx series since it was on the market) the differences in terms of quality and performance are negligible on the vast majority of functions. Then taking into account the cost of an additional graphics card (NVIDIA / INTEL / AMD) .... Probably a careful use of Threads and the good library could lead to a better quality / performance of what you want to do (but I can't help you specifically because I've never needed better performance / quality than the standard image resizing). Start from here: Embarcadero blog on OPENCL Bye
  7. DelphiUdIT

    I need the console window to stay open

    Now is OK, with proper heading and better indentation. You must terminate with a "end." (end with a period) The last begin is closed in this way in an "app console" (if you look a dpr file of a vcl application, you will see the same ... begin .... end.)
  8. DelphiUdIT

    I need the console window to stay open

    And something like this ? program Test; {$APPTYPE CONSOLE} {$R *.res} Uses System.SysUtils, WinApi.Windows; var Termina: boolean = false; function handle_ctrl_c(fdwCtrlType: UINT64): WORDBOOL; begin //If it returns TRUE then the chain of managers is not continued. //If I return FALSE then the next handler in the chain is also called. case fdwCtrlType of // Handle the CTRL-C signal. CTRL_C_EVENT: begin Termina := True; Beep(750, 300); writeln('Ctrl-C event'); result := TRUE; end; // CTRL-CLOSE: confirm that the user wants to exit. CTRL_CLOSE_EVENT: begin Termina := True; Beep(600, 200); writeln('Ctrl-Close event'); result := TRUE; //The program will' close ... end; // Pass other signals to the next handler. CTRL_BREAK_EVENT: begin Termina := True; Beep(900, 200); writeln('Ctrl-Break event'); result := TRUE; end; CTRL_LOGOFF_EVENT: begin Termina := True; Beep(1000, 200); writeln('Ctrl-Logoff event'); result := FALSE; end; CTRL_SHUTDOWN_EVENT: begin Termina := True; Beep(750, 500); writeln('Ctrl-Shutdown event'); result := FALSE; end; else result := FALSE; end; end; //Main begin //Implements ctrl-... handler SetConsoleCtrlHandler(@handle_ctrl_c, TRUE); Writeln(DateTimeToStr(now)+' - Is running - press CTRL-C to terminate or the key "F2"'); while (not Termina) do begin try sleep(10); //This is another way to catch a key //Pressing F2 key will exit if (GetKeyState(VK_F2) and $8000) <> 0 then begin Termina := true; //This is not necessary since there is a break condition break; end; //put here your code except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end; end.
  9. DelphiUdIT

    How many people use Delphi?

    Win11/Intel(R) Core(TM) i7-12700H CPU @ 2.30GHz (Max 4,7 GHz)/6P+8E-cores/20-threads/32GB/RAD11.3/Release/<below data> D:\spritz_bench>spritz_bench.exe spritz prng: 182.30 MiB/s D:\spritz_bench>spritz_bench.64.exe spritz prng: 196.31 MiB/s Lazarus 2.2.6 (Release 64 -O3) spritz prng: 174.48 MiB/s
  10. DelphiUdIT

    General Help Indeed...a long-shot here....

    That "variable" (Value) is not a global variable but a local one. It is in fact a different "object" in each single procedure. Very often these variables are automatically generated by component imports such as COM objects or wrapper or getter/setter generators. However, it is a standard acquired by programmers to use for example "Value" as a generic input datum in a procedure / function / method.
  11. DelphiUdIT

    General Help Indeed...a long-shot here....

    The color value (for example clAcqua) is matched to the input (status or value). Color, other than visual meaning, has no effect on the code (it shouldn't). Typically those controls were designed and used as a "level": the highest value "won" over the others and that was the state (color) displayed. The component is closely linked to the hardware (PLC), it must be thought of as a representation of the state and the PLC vice versa must be programmed to coherently represent the state. If not, you need to build your own component and/or derive from an existing one by overriding the methods. Bye P.S. To better specify, the component could work like this: the displayed color is represented by the highest active bit in Bit1, Bit2, Bit3 ..... etc., if more bits are active the highest one "wins", but typically ONLY one of these should be active.; the alarm bit has priority over all and if active the component will display the matched colour.
  12. DelphiUdIT

    General Help Indeed...a long-shot here....

    It is one-to-one color mapping, means the every 8 DI+ BitAlarm are assigned the a Color0-Color7 + ColorA(larm). Graphically, I don't know if the control provides for the possibility of displaying all 9 states at the same time.
  13. DelphiUdIT

    My program does not work

    May be you means: P.S.: .... I didn't see the Remy post ... void __fastcall TForm1::Button1Click(TObject *Sender) { int numbers[3]; int t; Edit1->Text = ""; //Clear the Edit1 for(t = 0; t < 3; t++) numbers[t] = t; for(t = 0; t < 3; t++) Edit1->Text = Edit1 -> Text + IntToStr(numbers[t]) + " "; //The new text is "added" to the Edit1 content (the number must be transformed into text) }
  14. Hallo, for those unaware, Embarcadero has posted updates to the new offline Help for Alexandria 11.3. This is the download link for the files. http://docs.embarcadero.com/products/rad_studio/ Bye
  15. DelphiUdIT

    ToDo seems to be broken in 11.3

    It works for me too.
  16. DelphiUdIT

    Find all mentions of the database

    You can use "grep" command line application (at command prompt). I use that to find reference of something in source directory of Rad Studio. I.e.: serching the word database in all PAS files in every subdirectories. You can repeat with *.DFM to search such reference in the object property.
  17. DelphiUdIT

    General Help Indeed...a long-shot here....

    I have never used Omron components (although I have been a direct customer of Omron for more than twenty years) because I developed my own series of components, starting from the communication protocols. This is because I had to develop applications that already used fiber optics before the 90s and Omron didn't have high-performance components at that time (let's just say it didn't have components...). However, I managed to find in my archives the COMPOLET 2.0 (year 2003) and they are for WINNT3 SP3 or Higher. If you want I can send to you a private message with link (on my server) to download them. If you are able to install these, with Delphi 5 you can extract the TLBs. I don't know if something else (e.g. FINS GW) is needed to install them (I hope not). Bye
  18. DelphiUdIT

    General Help Indeed...a long-shot here....

    I don't think you'll fix that easily, those components were part of communication packages that no longer exist. They were imported from ActiveX (Omron never supplied wrappers in Delphi, I'm going by memory) registered either as integrated communication packages or separate components. The CX_ServerLite and CX_Compolet components are currently available but they absolutely do not support the WINNT environment. If you don't have the components installed in your VM or you don't have the Type Libraries or ActiveX wrappers (*_TLB.pas), you can't do anything with Delphi. It is probable that to install the components in your WM, even if you could find them, you would need the SYSMAC_BOARD drivers (I think you are referring to a C200PC-ISA1 PLC, it's the only one I remember ever seeing). If you have the original PC available you could theoretically recreate all the wrappers from the installed ActiveX. Not an easy job but doable. But first check if you have *_TLB.PAS files somewhere, like in the IMPORTS sub-directory of DELPHI5 (in the original source, from the customer, ....): If "Yes" you can copy in your WM, register them and load all the FORMS. Bye P.S.: may be also if you have the *_TLB.pas files registered, some parts of the Form will not be design correctly if you don't have the components installed (normally they are DLL or EXE or OCX in that time).
  19. I don't know nothing about WinSat, but what you knew in the past is different from what it is now. [Win32_WinSAT may be altered or unavailable for releases after Windows 8.1.] <------------------------------------------- THIS DOESN'T EXISTS ANYMORE Look at new TLB that i post and this piece of source ... i hope this can help you. WINSATLib_TLB.pas
  20. DelphiUdIT

    E2137 Method not used in base class

    Also "inherited" should be removed, as the method is not a "redeclaration" of an existing method.
  21. Is not a normal DLL is a COM object. This is a type library definition (you can make your own with IDE). Bye WINSATLib_TLB.pas
  22. Win32_WinSAT class Article 12/12/2020 2 minutes to read [Win32_WinSAT may be altered or unavailable for releases after Windows 8.1.] <-------------------------------------------
  23. DelphiUdIT

    SSL not found when using idHttp in docker image

    I never use a DOCKER, I always used normally operating surface and the only things that you need are the two .so libraries x Linux. In one of my original projects, I used the standard Indy release with the Delphi, the libraries that I had are 1.0.2u (Linux 64 bit) but the names exposed are: libcrypto.so.1.0.0 libssl.so.1.0.0 I don't remember why (it happened 2 years ago) but i had also in the same directory the binary copy of the libraries with these names (and that i think was for Indy link); libcrypto.so libssl.so If you have your Linux app, these libraries and optionally the .pem certificates you server must works. You don't need other things. Bye
  24. DelphiUdIT

    Combobox1.Items.AddObject(....)

    May be you mean: var tempointer: Pointer; tempointer := Combobox1.Items.Objects[Combobox1.ItemIndex]; Combobox1.ItemIndex := Integer(tempointer^); But even if this is correct, the starting point is incorrect: PAY ATTENTION: SqlQuery1 I think dynamically allocates Fields[1] and therefore your POINTER will be invalid after a new QUERY is executed. The pointer used with the AddObjects function should be permanent and "last" for the entire existence of the program (until you know what you are doing ) Bye
×