Leaderboard
Popular Content
Showing content with the highest reputation on 09/27/24 in all areas
-
ICS V9.3 has been released at: https://wiki.overbyte.eu/wiki/index.php/ICS_Download ICS is a free internet component library for Delphi 7, 2006 to 2010, XE to XE8, 10, 10.1, 10.2, 10.3, 10.4, 11 and 12 and C++ Builder 10.4, 11 and 12. ICS supports VCL and FMX, Win32 and Win64 targets. Beware C++ have not been tested recently due to lack of support from such users. The distribution zip includes the latest OpenSSL 3.0.15, 3.2.3 and 3.3.2, for Win32 and Win64. Changes in ICS V9.3 include: 1 - V9.3 continues the simplification of use of ICS components by consolidating many types and constants into the OverbyteIcsTypes unit, avoiding projects needing to find and add specific units before they will build. For XE2 and later, OverbyteIcsTypes and OverbyteIcsSslBase will be added automatically when components needing them are dropped on a form, or that form accessed for existing projects. One benefit of this change is removing dependence on several units for many components and applications, it should be possible to remove OverbyteIcsWinsock, OverbyteIcsLIBEAY, OverbyteIcsSSLEAY and OverbyteIcsLogger from most applications, and also other units. See https://wiki.overbyte.eu/wiki/index.php?title=Updating_projects_to_V9.3 for more information. 2 - Previously, the Windows Certificate Store was supported on Windows for all components and samples, despite it not always being required. There are three new defines {$DEFINE MSCRYPT_Clients}, {$DEFINE MSCRYPT_Servers} and {$DEFINE MSCRYPT_Tools) that determine which components can use the store, at least one must be set or applications that need the store will fail. Although these new defines all default to enabled in the OverbyteIcsDefs.inc supplied with V9.3 and later, unless this file is installed, Windows Certificate Store will be unavailable. These defines are disabled for non-Windows platforms and for C++ Builder which has bugs. 3 - Added new application independent monitoring, comprising a client component and server sample. The ICS Application Monitor TIcsAppMonCli client component is designed to report to an ICS Application Monitor server, which will ensure the main application remains running. The ICS Application Monitor server IcsAppMon.exe is designed to monitor ICS applications using the TIcsAppMonCli client component, and ensure they remain running, restarting the application if it stops or becomes non-responsive, or on demand. Primarily to keep ICS server Windows services running non-stop, but may also be used for network wide monitoring of ICS applications. Client and server both use the TIcsIpStrmLog component with a simple TCP protocol. More information at https://wiki.overbyte.eu/wiki/index.php?title=FAQ_ICS_Application_Monitoring 4 - The HTTP client components TSslHttpCli and TSslHttpRest have new RespMimeType and RespCharset response properties parsed from the Content-Type header to avoid applications needing to parse this headers. Fixed a problem in V9.2 where a missing / was added to the start of the request path, but was not needed for absolute paths used for proxies. 5 - The TIcsIpStrmLog streaming log component has improvements for TCP Server mode when multiple remote clients connect. Previously the same data was sent to all remote clients (the original concept being remote logging), but now applications can send data to specific remote clients, and more easily check which remote client is receiving data. This change means TIcsIpStrmLog can be used as the core of many TCP servers with different protocols, such as the new IcsAppMon sample, see above. 6 - The TSslHttpRest and component has a new way for applications to check SSL certificate chains themselves, ignoring OpenSSL bundle checks, usually for self signed private certificates, maybe checking certificate serials, names or public key. If LogSslVerMethod = logSslVerOwnEvent, a new event OnSslCertVerifyEvent is called so the application can check the chain and change the verify result appropriately. 7 - Improved the ability to customise SSL ciphers if the ICS defaults need to be changed. TSslContext and TIcsHosts have three properties, SslCipherList for TLSv12 ciphers, SslCipherList13 for TLSv13 ciphers, and SslCryptoGroups sets the cipher curve groups allowed (like P-256 or X25519). Beware old SslContexts may include group P-512 which must be corrected to T-521. SSL handshake responses now show the curve group used for OpenSSL 3.2 and later. The OverbyteIcsHttpsTst client sample may be used to test the new cipher options, and they will be read from IcsHosts INI files for servers. 8 - Added a new web server sample OverbyteIcsBasicWebServer1.dpr which is a simplified version of OverbyteIcsSslMultiWebServ ignoring configuration INI files, security features, session data, most demo pages and most logging, and settings for localhost set in code, search for IcsHosts to change IP addresses, etc. This sample should be easier to use as a basis for new web server applications. The existing samples OverbyteIcsSslMultiWebServ and OverbyteIcsDDWebService have a new index.html template page, and default to localhost 127.0.0.1 with an internal localhost SSL certificate, so should always response to https://localhost/ without any INI file changes. 9 - Fixed an HTTP web server problem in V9.2 to avoid repeated redirection for virtual default page /, was adding /// etc. 10 - Updated OpenSSL binary and resource files to releases 3.3.2, 3.2.3 and 3.0.15, only one of which will be linked according to defines. 11 - Restored the sample OverbyteIcsConHttp.dpr which is a console example, now supports SSL by replacing THttpCli with TSslHttpRest, no longer needs any events or a message loop for a single sync request, so a less code than without SSL. Now contacts https://wiki.overbyte.eu/wiki. 12 - A lot of changes have been made preparing ICS for Linux. Corrected loading OpenSSL on Posix, now loads the system supplied OpenSSL 3 DLLs on Ubuntu 22.04. The Linux package now builds correctly, but beware WSocket is not yet supported on Linux so no protocols will work. There is a new IcsPemTest FMX sample that works on Ubuntu 22.04 and which will create ICS signed SSL certificates. Note, MacOS support is disabled pending the new Posix implementation. The release notes for V9.3 are at https://wiki.overbyte.eu/wiki/index.php/ICS_V9.3 All ICS active samples are available as prebuilt executables, to allow ease of testing without needing to install ICS and build them all. There are four separate zip files split into clients, servers, tools and miscellaneous samples which can be downloaded from https://wiki.overbyte.eu/wiki/index.php/ICS_Samples
-
Constant declarations keeps baffling me (don't know enough I guess)
Remy Lebeau replied to Tommi Prami's topic in RTL and Delphi Object Pascal
It is true that variables can't be initialized when using the 'var' block at the top of the function. But inline variables can be initialized: begin var foo: Integer := 10; // OK -
WebStencils Compared to PageProducers
corneliusdavid posted a topic in Tips / Blogs / Tutorials / Videos
Delphi 12.2 introduced a new text-processing engine, WebStencils, that can be used in WebBroker and other applications to generate HTML and other template-based text. To get my head around how to work with this, I wrote a couple of small WebBroker applications, one using PageProducers and the other doing the same thing using WebStencils. You can read about it in my latest blog entry, Introducing WebStencils and download the projects from Github. I hope this is useful for learning about this new text-processing engine. -
Constant declarations keeps baffling me (don't know enough I guess)
Stefan Glienke replied to Tommi Prami's topic in RTL and Delphi Object Pascal
Clever way of introducing thread-unsafety 😉 -
Constant declarations keeps baffling me (don't know enough I guess)
mvanrijnen replied to Tommi Prami's topic in RTL and Delphi Object Pascal
yes, so called "CONSTANT VARIABLES" 😉 -
Constant declarations keeps baffling me (don't know enough I guess)
Uwe Raabe replied to Tommi Prami's topic in RTL and Delphi Object Pascal
... unless you allow that with a compiler directive: Writeable typed constants -
File extension icons all gone with D12.2
Uwe Raabe replied to Andrew Spencer's topic in General Help
Tools > Options > IDE > File Association -
In DAV_Compiler.inc file, try adding the following code right after the {$IFDEF VER350}..{$ENDIF VER350} block: {$IFDEF VER360} // RAD Studio 12 Athens {$DEFINE BDS} {$DEFINE COMPILER27} {$IFDEF BCB} {$DEFINE BCB27} {$ELSE} {$DEFINE DELPHI27} {$DEFINE DELPHIRX2} // synonym to DELPHI27 {$DEFINE DELPHICOMPILER27} {$ENDIF BCB} {$IFDEF CPUX64} {$DEFINE 64BIT} {$DEFINE CPU64} {$DEFINE CPUx86_64} {$UNDEF CPU386} {$UNDEF CPU32} {$ELSE} {$DEFINE 32BIT} {$DEFINE CPU32} {$ENDIF} {$DEFINE RTL350_UP} {$UNDEF UNKNOWN_COMPILER_VERSION} {$ENDIF VER360} This is the same code, only {$IFDEF VER350} is replaced with {$IFDEF VER360}. See Compiler versions: https://docwiki.embarcadero.com/RADStudio/Athens/en/Compiler_Versions
-
Serialize/Deserialize Enums with no RTTI
Uwe Raabe replied to Larry Hengen's topic in RTL and Delphi Object Pascal
I know, that probably won't solve your problem, but I usually get rid of these kind of enumerations in favor of proper ones supported by RTTI. The numerical values are handles by record helpers: type TReportTypeCode = (reportTypeCodeSTR, reportTypeCodeLCTR, reportTypeCodeCDR, reportTypeCodeLVCTR, reportTypeCodeEFTR); TReportTypeCodeHelper = record helper for TReportTypeCode private const cMapping: array[TReportTypeCode] of Integer = (102, 106, 113, 14, 145); function GetAsInteger: Integer; procedure SetAsInteger(const Value: Integer); public property AsInteger: Integer read GetAsInteger write SetAsInteger; end; function TReportTypeCodeHelper.GetAsInteger: Integer; begin Result := cMapping[Self]; end; procedure TReportTypeCodeHelper.SetAsInteger(const Value: Integer); begin for var idx := Low(Self) to High(Self) do begin if cMapping[idx] = Value then begin Self := idx; Exit; end; end; raise EInvalidOperation.Create('invalid Integer value for TReportTypeCode'); end; Now there is no more casting to and from Integers. -
The interfaces in Delphi are bad?
Rollo62 replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
@Dalija Prasnikar Yes, I think compiler/linker could get a little smarter though, maybe in the direction like FixInsight or PascalAnalyser can do. To find common anti-patterns, and give warnings, that should be not so far out of reach. But you're right, maybe this is a task for some separate tool probably. -
The interfaces in Delphi are bad?
Fr0sT.Brutal replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
There are plenty of object wrappers that allow using ref-counting with any object, and everyone could write his own one in 10 minutes (I did, and use it for temp datasets) -
The interfaces in Delphi are bad?
Dalija Prasnikar replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
No,, but learning takes time. I am not talking here about lazy people that don't want to learn, I am talking about efficiency of learning a language that has additional levels of complexity comparing to learning language that doesn't and where both languages are generally suitable for solving some problem. I know that knowledge accumulates over time, so you will not have to relearn things you know the next time around, but such things do have overall impact on productivity. -
The interfaces in Delphi are bad?
A.M. Hoornweg replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
You shouldn't, because the component's owner manages its lifetime. Refcounted objects do not have an owner, they manage their own lifetime. Freeing an object twice is a really bad idea.