Leaderboard
Popular Content
Showing content with the highest reputation on 07/31/19 in all areas
-
IDE Fix Pack 6.4.3 breaks compilation
jbg replied to Primož Gabrijelčič's topic in Delphi Third-Party
This bug is now fixed in version 6.4.4. IDE Fix Pack 6.4.4 for Delphi 10.3.2 -
Working as designed. Compiler evaluates mathematical operation first and only then it will do assignment. Since your operation works on two integers, the result will also be integer - and it will overflow at compile time. You need to typecast at least one of the operators to Int64 to widen operation result.
-
Refer to Form Control without using the Form unit?
Lars Fosdal replied to Mike Torrettinni's topic in VCL
I had a similar problem where a lot of code was referring to the class name of forms to do navigation, and hence including the various form classes all over the place to get the class name. I ended up making a unit, something like this: unit NavigationHelp; interface type TNavLink = record MainForm: string; ReportForm: string; QueryForm: string; end; const NameNotSet = 'Name not set'; {$WRITEABLECONST ON} const NavLink: TNavLink = ( MainForm: NameNotSet; ReportForm: NameNotSet; QueryForm: NameNotSet ); implementation end. and in the init section of my various form units, I updated the constant to the actual class name unit MainFormU; interface uses NavigatorHelp; type // ... implementation // ... initialization NavLink.MainForm := TMainForm.ClassName; end. You could apply the same pattern to form and control handles and set the handles in the respective OnFormShow routines. type THandleRef = record MainForm: THandle; CustomButton: THandle; end; const HandleRef: THandleRef = ( MainForm: 0; CustomButton: 0 ); ... TMainForm.FormShow(Sender: TObject); begin HandleRef.MainForm := Self.Handle; HandleRef.CustomButton := CustomButton.Handle; end; That is a fairly simple "brute force" method to eliminate circular refs. -
Disaster planning by archiving GetIt installers
dummzeuch replied to Tom F's topic in Delphi IDE and APIs
Since I have never used GetIt for anything: Does installing those components that are free (not just demos) and those that you can buy via GetIt (is that actually possible?) also install the source code? In that case I would not bother backing up the components or any installer files but would move the source code to my own SCM. Whenever an update from GetIt is available, I would then update that SCM. Updating from GetIt would only be done on one particular installation, every other installation would use files from the SCM. In particular I would expect a company that uses Delphi to have a policy of never directly using GetIt and never use binary only components. Any company that does not have such a policy I consider likely to go belly up in the near future. It has become more likely that a component vendor goes out of business than ever before. (OTOH, I am not sure whether a company that uses Delphi nowdays isn't doomed anyway. But hey, I am working or one. 😉 ) -
String to Date conversion (yet another one)
Stefan Glienke replied to ertank's topic in RTL and Delphi Object Pascal
Yeah, minimal... like dealing with every possible language for weekdays the mail could contain regardless the local language of the system the software is running on... -
IDE Fix Pack 6.4.3 breaks compilation in Rio 10.3.2 for our flagship application. After compile or rebuild, I get [dcc32 Fatal Error] FAB .gRPC . pas ( 265): F2084 Internal Error: AV0D0F16E4(0D080000)-R0000000C-0 Wihout IDE Fix Pack, compilation works fine. Any suggestions?
-
IDE Fix Pack 6.4.3 breaks compilation
jbg replied to Primož Gabrijelčič's topic in Delphi Third-Party
You can try to set the IDEFixPack.DisabledPatches environment variable to a semicolon separated list of patch names. The easiest way is to open a cmd.exe and use SET IDEFixPack.DisabledPatches=CodeGenMod.Linker.CombineDllImportTab;CodeGenMod.OmitResultCopyRecord bds.exe That way you don't have to change your system and you can faster find the the broken patch. I would start by disabling all "CodeGenMod" patches first. Even if you don't use the "-x-XX" command line options the patches have to hook the compiler's code. The next step would be to use a larger block until the compiler starts working correctly (a rebuild of the project may be needed because of possible defect *.dcu files). Then you can reduce the number of disabled patches until you reach the patch or the patches that crash the compiler. Here is the list of compiler patches. CodeGenMod.Linker.CombineDllImportTab CodeGenMod.OmitResultCopyRecord CodeGenMod.Win32.FastFloat CodeGenMod.Win32.FastFuncProlog CodeGenMod.Win32.FastIntfVirtualStub CodeGenMod.Win32.OptimizedCodeGen CodeGenMod.Win32.VirtFinalSealed Compiler.BackgroundCompilerFileExists Compiler.CacheControl Compiler.CompareFileName Compiler.CRTL2010 Compiler.DbkGetFileIndex Compiler.DirectorySearch Compiler.DrcFileBuffer Compiler.Ext.LinkerOptions Compiler.FileNameStringFunctions Compiler.FileSearchCache- Compiler.FindPackage Compiler.Fixes Compiler.ImportedSymbol Compiler.KibitzCompilerImplUnitReset Compiler.KibitzGetValidSymbols Compiler.KibitzIgnoreErrors Compiler.MapFile.fprintf Compiler.MapFileBuffer Compiler.Memory.Shrink Compiler.NoUnitDiscardAfterCompile Compiler.Optimization Compiler.Package.CleanupSpeed Compiler.PrefetchToken Compiler.ReleaseUnusedMemory Compiler.ResetUnits Compiler.Scanner.GetSourceLine Compiler.SourceOutdated.1 Compiler.StrLenCalls Compiler.SymLookup Compiler.SymLookupScope Compiler.Unit.RdName Compiler.UnitBlockFreeHook Compiler.UnitFindByAlias Compiler.UnitFreeAll Compiler.UnlinkImports Compiler.WarnLoadResString Compiler.WriteCloseHandleThread ErrorInsight.SetKibitzedSinceCompiled -
WinAPI to query if a form is ready to Rock.
PeterBelow replied to Tommi Prami's topic in Windows API
Some of the form properties (e.g. border and bordericons) are implemented via window styles on the API level, and Windows only honors some of the styles when the window is first created. Changes to these properties recreate the window handle for this reason. Another reason are modal forms with popupmode pmauto or pmexplicit; their window handle has to be recreated when they are shown to tie them to their popup parent in Z-order. Changing the formstyle also recreates the handle. -
Record constants that are actually constant?
Stefan Glienke replied to Lars Fosdal's topic in RTL and Delphi Object Pascal
Reading the documentation is underrated these days, eh? http://docwiki.embarcadero.com/RADStudio/Rio/en/Declared_Constants#Typed_Constants To solve this particular case of providing structured data to unit tests via attributes I am referring to an approach where you specify where to get the data from in the test attribute and write the code that then does not have to be const in methods that are accessible via RTTI. Here an example how to use this with the Spring.Testing extensions for DUnit: https://bitbucket.org/snippets/sglienke/pe7xAK/dunit-with-external-test-data The approach itself is borrowed from NUnit - see https://github.com/nunit/docs/wiki/TestCaseData -
WinAPI to query if a form is ready to Rock.
Der schöne Günther replied to Tommi Prami's topic in Windows API
A TWinControl has a method RecreateWnd(): http://docwiki.embarcadero.com/Libraries/en/Vcl.Controls.TWinControl.RecreateWnd Maybe you can have a look at the VCL sources where this gets called... -
WinAPI to query if a form is ready to Rock.
Der schöne Günther replied to Tommi Prami's topic in Windows API
Wouldn't that be the easiest? I don't see much of a "problem" of how to know when everything is ready. By default, it should be after the first time OnShow (or maybe even OnActivate) has been called. This can be done in your base class. If you need more elaborate logic in one form class, then you can override that behaviour. -
WinAPI to query if a form is ready to Rock.
PeterBelow replied to Tommi Prami's topic in Windows API
There is no panacea for this kind of problem, too much depends on how the form in question has been set up. What you can do from "outside" the process is check if the window is visible (IsWindowVisible) check whether it is the current foreground window (GetForegroundWindow) check whether its message loop is running (WaitForInputIdle, or use SendMessageTimeout to send a do-nothing message to the form, e.g. wm_null, the call will not return until the loop is running) Nothing will help you if the form does some kind of delayed initialization, e.g. using a timer started when the form is created. Also keep in mind that a Delphi form may recreate its window handle at the drop of a (virtual) hat during the initialization phase. -
Disaster planning by archiving GetIt installers
Dalija Prasnikar replied to Tom F's topic in Delphi IDE and APIs
I never realized that some libraries were available only through GetIt. This is a problem indeed. I guess that best course of action would be submitting QP report (once it finally gets online) and post the link here so we can vote on it. -
Disaster planning by archiving GetIt installers
David Schwartz replied to Tom F's topic in Delphi IDE and APIs
a lot of stuff on GetIt has nowhere else to get it from. Raize Components, for example, have not been distributed directly since they were incorporated into GetIt. I haven't been able to make GetIt work for 18 months due to persistent errors that have gone unfixed. How am I supposed to get updates any other way? Heck, I don't even know if GetIt distributes source or just the object files! A lot of my personal projects have become hostage to this Good Idea that has run amok, and if my maintenance agreement expires, they may well disappear -- if Embt refuses to fix problems that occur and you can only get a fix if you have an active maintenance contract, you're basically hosed. Also, while I don't personally use them, there are several libraries that commercial products I've worked on over the past 10 years that rely on other libraries currently distributed only via GetIt. Because newer updates were unavailable last year, we spent quite a bit of time migrating older source to newer Delphi versions. This was not looked on favorably by Management, because we had just spent a lot of money on updating our licenses and when we contacted Embt, we were only told that there's a problem with GetIt and we'd just have to wait until it was fixed -- "probably the next release". What the heck kind of "support" is THAT when your company has shifted to a business model based around SELLING SUPPORT AND MAINTENANCE CONTRACTS??? It's PATHETIC. Embt has chosen to bury stuff inside of GetIt while refusing to offer ANY KIND OF ALTERNATE MEANS OF DOWNLOADING IT, and it's stuff that's used in a LOT of LEGACY projects. I don't care what anybody's PERSONAL opinion of GetIt is ... it has become the ONLY means of accessing several Delphi-specific libraries that are used in LOTS of LEGACY apps currently being supported by Delphi customers who have active maintenance agreements, and it would be cost-prohibitive to replace some of them. -
This is avaiIable in the OverbyteIcsSslJose unit: { digests and hashes - note all digests are binary bytes in AnsiStrings } function IcsHMACDigest(const Data, Key: AnsiString; HashDigest: TEvpDigest = Digest_sha256): AnsiString; function IcsHMACDigestEx(const Data, Key: AnsiString; HashDigest: TEvpDigest = Digest_sha256): AnsiString; function IcsHMACDigestVerify(const Data, Key, OldDigest: AnsiString; HashDigest: TEvpDigest = Digest_sha256): Boolean; With various other functions used for Json Object Signing and Encryption, Angus