DelphiUdIT
Members-
Content Count
449 -
Joined
-
Last visited
-
Days Won
8
Everything posted by DelphiUdIT
-
I used and currently use styles. I customized two styles and since years I use those. Even with Delphi 12 there is a need for "Rodrigo Ruz's VCL Style Utils" to refine some smudges of some components (one for all TSplitView). I think, as others have said in that thread, that the look and feel are greatly improved over the normal OS dependent look.
-
How to read an .ini file of unknown encoding a FormatSettings?
DelphiUdIT replied to Tom F's topic in FMX
I add to this discussion (which talks about formats in INI files) that a problem similar to that of the date also exists in the writing and reading of float values (i.e. numbers with decimal points). It is necessary to use the TFormatSettings and set the correct values (which are those of the files and not of the language). The example is when you go to write a value in an environment set in Italian (where the "comma" is the decimal separation sign) and perhaps then read it in an environment set in English (where instead it is the "dot "). I override ReadFloat and WriteFloat of TIniFile to correct that to always read and write the right values. Of course it is for compatibility and maintenance of the old programs, the new ones use a local database to store the data. -
TColor breaks memory layout
DelphiUdIT replied to dormky's topic in Algorithms, Data Structures and Class Design
May be you must write a "little" interface between disk data and you record data. You can maintain your record data in memory without any changes, and when you read and write the data you can adjust in memory the reading. If you works with records, you can works writing and advances records, put the variables in private section (renaming them) and writing functions with the old names: current.field := V22.field TV22 = record private fV22_field: cardinal; function getV22_field: smallint; procedure setV22_field(Value: smallint); public property field: smallint read getV22_field write setV22_field; end; function TMyRecord.getV22_field: smallint; begin //You can do here what you want to adjust the operation Result := fV22_field; end; procedure TMyRecord.setV22_field(Value: smallint); begin //You can do here what you want to adjust the operation fV22_field := Value; end; Of course you must do this for every field you have declared that needed to be adjust. -
May be those can Help (simple google search)? https://github.com/mattia72/vim-delphi https://github.com/Tanikai/vi-delphi
-
If NetWkstaTransportEnum belongs to APIs that use netbios, netbios itself may be disabled. Microsoft has begun to disable NETBIOS by default, still leaving the option to enable and use it. I read an article about this some time ago but I can't find it now.
-
Look this: https://en.delphipraxis.net/topic/10560-get-mac-address-using-indy/?do=findComment&comment=83985
-
Two weeks ago FastMM5 was updated: But Delphi 12 is a new release so be sure that all third parts components are updated and also that in the QP there are not such issue already posted.
-
... of course I'm aware .... It was a ironical replay to @David Heffernan ... Mantra "But it compiles to native code!" is a must for my business, may be only for me but that's enough. I have customers with dozens of machines (industrial lines) who are tired of hearing about frameworks that must be constantly updated, incompatibilities between functional blocks (effectively DLLs and third-party components) with each update, technology changes for "opportunities" of suppliers (for example instead of working with .Net 4.0 there is now .Net CORE x.x) which make many solutions adopted on old machines incompatible with the new ones. We are not talking about Java applications linked to a specific JRE which due to their "incorrect" development cannot be selected from the application itself (so if there are multiple JREs installed... nothing works). The customer who does not have "programming" as his core business but only the use of an IT product is not interested in the outline at all... he is only interested in not having any kind of problem in using it for the next few years. This is. How much the machine code is optimized is not a problem for my applications, or at least what optimization there is is sufficient. If I want optimized and performant code I use C or C++ (as already indicated)...
-
"priceless advantages" means that for me that solution has no price ... without that I will not be able to "sell" my product. Lol ... I didn't know that are toolchains that produce native code for Python, Java and C# ... may be I'm really old ... but I'm aware for C and C++ ( ) ...
-
I encountered similar problems in debugging, where some variables (mostly inline ones, but also some local ones) could not be inspected. But at normal runtime I have never encountered any problems. I use ExtractFilePath in a new project with Delphi 12 these days intensively with Threads processing millions of images and I haven't had any problems. N.B.: ... I only use English characters (plus spaces, underscores, ...) for directory and file names.
-
I wouldn't consider Delphi as legacy software. It is one of the few environments that produces native code, and if on the one hand this method is considered "old", on the other it offers priceless advantages. For the work I do, where longevity of applications is necessary (I deal with artificial vision in the industrial field), Delphi is perfect. Same program used by machines starting from Windows 7 up to the current 11, without intermediate frameworks that only complicate the distribution and maintenance of applications. The ease with which modern environments approach programming (see Python one for all) completely overrides the knowledge and skills of a programmer, making this world APPARENTLY simpler and more banal than it is. It is obvious that young people approach, for example, Python or Java rather than Delphi for certain types of applications (typically WEB) where with a few lines of code I have built an app that "runs" on the web. On C#, in my opinion a language between Pascal and JAVA, the choice is certainly oriented by a strong demand on the market driven by the commercial power of Microsoft which certainly makes this language more attractive for young people. And I continue, like many other companies from what I see in the various meetings both in proximity and in webinars, to develop new applications with Delphi (and with C++ for some peculiar hardware functions). I use Lazarus/FPC to support an Italian forum, but the environment, although declared universal and compatible with all available hardware and OS, is far from this dream. The IDE is also far from those of Delphi in terms of features and functionality and even the basic components provided are limited, relying completely (or almost) on third-party packages. The RTL support is incomplete, the generics are actually not usable, there is no support for themes / styles, the debugger (made entirely in Pascal) despite being more stable than Delphi's is still very crude and limited on some functionality. Last but not least, one of the big gaps is the documentation: for a beginner, finding exhaustive documentation on Lazarus/FPC is a challenge. Delphi uses the documentation created and updated over time starting from Borland and in my experience it is second only to the "exterminated" former Microsoft KB (also new environments like Android Studio have good documentation). Lazarus/FPC's strong propensity to "generalize" itself across a variety of OSes means that many features typical of a specific operating system (I'm talking about Windows in my case for example) are not available or exposed. An advantage to be attributed to it is that for Linux lovers the IDE is also available in their beloved OS.
-
How to attach a DigiCert Token certificate to exeutable
DelphiUdIT replied to Bart Kindt's topic in Delphi IDE and APIs
Why don't you use SIGNTOOL the free tool from Microsoft ? Look at: https://learn.microsoft.com/en-us/dotnet/framework/tools/signtool-exe -
How to enable SafeSEH, CFG flags for Delphi 10.4 Dll's/Exe's?
DelphiUdIT replied to raj_delphi's topic in General Help
I use that flag in Delphi and in C++ in all my applications since many years, and no issue was signaled about that. But i never used it in a Windows Server environment. And I noted that since I used it no signal about application is done from Defender (SmartScreen and others) and from others Corporate AntiVirus. Some of my applications run in critical secure environment (they are digitally signed too) and I know that who use them use AV control settings set to "maximum control" like Heuristics, but I'm pretty sure that they use Windows with CFG setting in normal mode. But I was probably just lucky. Application that use CFG (really use it) is working in sync mode (the compiler takes care of autonomously inserting the appropriate code) with OS (in normal mode or in strict mode). The application can use it partially or in full environment (or none) and with CFG enable in Normal Mode (or without CFG enabled) there are no issue. In "strict mode" the OS should no load any application (or DLL) that have this flag OFF. But I don't know if in this scenario the application should really use the CFG (I think that for some API functions like LoadLibrary for example the OS should react in some way, but I have not experience). For better knowledge look at this page: https://learn.microsoft.com/en-us/windows/win32/secbp/control-flow-guard -
How to enable SafeSEH, CFG flags for Delphi 10.4 Dll's/Exe's?
DelphiUdIT replied to raj_delphi's topic in General Help
For SEH you can look at this: https://github.com/vic4key/SEH-For-DELPHI For CFG (Control Flow Guard), you can set the flag that signal that your program adheres to, but there is not implementation in Delphi compiler (the same like @Kas Ob., I not sure about that). Put in you DPR source this line, Process Explorer will show you that the flag is activated.: {$SETPEOPTFLAGS $4000} //SET CFG ON (Control Flow Guard) For your DLL you can use this (I use it in C++): IMAGE_DLLCHARACTERISTICS_GUARD_CF("IMAGE_DLLCHARACTERISTICS_GUARD_CF", 0x4000, "Image supports Control Flow Guard.") P.S.: I DON'T KNOW HOW THESE SETTINGS WORK IN A CFG-AWARE Operating System (like Windows Server) ... you must try ... -
There are others variant of that function, with options to replace all occurrences and case sensitive or not. See https://docwiki.embarcadero.com/Libraries/Athens/en/System.SysUtils.StringReplace for details.
-
Indy http.post with certificate: Could not load key
DelphiUdIT replied to José Antonio's topic in Indy
For this I have no suggestions .... seems that something about server configuration (SAN reference of certificate wrong or with *) but i have not experience with this. You can try this: https://www.ssllabs.com/ssltest/ to verify the site (they expose the anomalies). Bye -
Indy http.post with certificate: Could not load key
DelphiUdIT replied to José Antonio's topic in Indy
If the KeyFile not has any password, then event will not be trigger, but if you use a certificate you must use also the keyfile. The error you'll refer here is the original (EIdOSSLLoadingKeyError with message: 'could not load key, check password. error: 0B080074:x509 certificate routines:X509_check_private_key:key values mismatch') ? May be the KeyFile and and Certificate don't match .... Also, suggestion for usage: don't use "Method" and "SSLVersions" of SSLIOHandler together, they override each others. Use only "SSLVersions". -
Indy http.post with certificate: Could not load key
DelphiUdIT replied to José Antonio's topic in Indy
Use a certificate with Http client is normally not needed, but If you must use it (like in authentication purpose) then you must use also use private key. (uncommented //IdSSLIOHandler.SSLOptions.KeyFile := 'privatekey.pem'; ) and in the GetPassword event write: procedure xxx.GetPassword(var Password: string); begin Password = YourPasswordForPrivateKey; end; The private key and the password of course will NOT be sent to server. Remember that the password should not hard coded in the executable, but should be ask to operator and used like a cache (expire with time or after N. use). Bye -
This is like Wedgewood Light style works in a VCL project with the standard PageControl (I dont'have Raize component). There is not any issue. May be this is an issue of TrzPageControl, but should be see how the style is implemented in that control (or if some design properties of the control are set and incompatible with style).
-
Indy http.post with certificate: Could not load key
DelphiUdIT replied to José Antonio's topic in Indy
I never use password with private key, but i think that you should use the OnGetPassword event of the IOSSLHandler that you use. Assign the correct value to "Password" parameter of the event. Bye -
I don't know with Indy, but in Delphi there are the WinApi.IPHlpApi e WinAPi.IPTypes that are acquired from Project JEDI. You must enumerate the Interface cards and looks for properties: Uses WinAPi.IpHlpApi, WinApi.IpTypes; var NumInterfaces: Cardinal; AdapterInfo: array of TIpAdapterInfo; OutBufLen: ULONG; begin GetNumberOfInterfaces(NumInterfaces); SetLength(AdapterInfo, NumInterfaces); OutBufLen := NumInterfaces * SizeOf(TIpAdapterInfo); GetAdaptersInfo(@AdapterInfo[0], OutBufLen); for var i := 0 to NumInterfaces - 1 do begin (* These are the 6 bytes MAC Addresses of Interfaces AdapterInfo[i].Address[0], AdapterInfo[i].Address[1] AdapterInfo[i].Address[2], AdapterInfo[i].Address[3] AdapterInfo[i].Address[4], AdapterInfo[i].Address[5] *) end; end; EDIT: This works only in Windows platforms.
-
He must install the community edition which is incompatible with any other installed version. I don't know how the CE tests the presence of another product, but certainly by deleting that directory you remove traces of any other licenses (which in the new versions also affects AppData\.......\Embarcadero). As per your suggestion, he could make a copy to possibly keep the data.
-
TAKE CAREFULLY AND UNDERSTAND WHAT YOU ARE DOING. WHAT I TELL YOU MAY DAMAGE WINDOWS INSTALLATION. DO IT AT YOUR RISK. All the paths are the standard paths, verify that you do the right thing in your installation. First, delete these folders (and all contents, YOURNAME is the name of your account): "C:\ProgramData\Embarcadero" "C:\Program FIles (x86)\Embarcadero" "C:\Users\YOURNAME\AppData\Roaming\Embarcadero" "C:\Users\YOURNAME\AppData\Local\Embarcadero" Then with Regedit utility delete these keys (and all sub): HKEY_CURRENT_USER\Software\Embarcadero HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Embarcadero That's should be enough. Bye
-
Delphi CE application accesses unknown IPs
DelphiUdIT replied to everybyte's topic in Network, Cloud and Web
Virus Total "simply" report what append to all environment when the software run. What the SO does is not under control or analyzed from VT. I think the you can send how many applications you want to Virus Total and all of them will be signaled for those "issue". All the IP calls don't come from the software but from the common environment loaded, one hundred DLLs or more? Windows makes many IP calls for a multitude of needs, so this should not be a "meter" to measures an issue. -
Delphi CE application accesses unknown IPs
DelphiUdIT replied to everybyte's topic in Network, Cloud and Web
Virus Total use virtual environment to test the application, so is possible (may be sure) that some DLL of Windows environment call Internet location to do something (think about SmartScreen that search for information about executable). So, that is not a Issue (and Virus Total list only one of many antivirus engine to exploit that). Bye