A.M. Hoornweg
Members-
Content Count
473 -
Joined
-
Last visited
-
Days Won
9
A.M. Hoornweg last won the day on August 2
A.M. Hoornweg had the most liked content!
Community Reputation
144 ExcellentRecent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
In that case it may have to do with the changed FPU flags behavior in Delphi 12. Try doing this right before calling your DLL, does it make a difference? SetFPUMask([exdenormalized, exunderflow, exprecision]); This setting makes the FPU behave like in previous Delphi versions. In other words, a FP division by 0 will generate an exception instead of continuing the code path with a NAN result.
-
Please verify if "sizeof (tViewerParams)" gives the same result in all compilers. Also, is the calling convention to the dll function declared identically and clearly in all projects (e.g. "stdcall") ?
-
The thing that may bite you here is field alignment. The compiler that created the DLL and the compiler that created the *.exe must use identical settings for field alignment so they expect the members of the record at identical offsets. see https://docwiki.embarcadero.com/RADStudio/Athens/en/Align_fields_(Delphi)
-
@StephenM: You write "It ingests a data structure that identifies a report". Please be aware that there are strict limitations about what data types you can safely pass between the exe <--> dll boundary. Can you describe what this data structure looks like?
-
Hello all, I saw how FreeAndNil is implemented in the RTL using a "CONST [ref]" parameter and then a little "tweak" is used to NIL the variable being referenced. I wondered why the heck the object wasn't simply passed as a VAR parameter in the first place. Until I tried that out and found that it wouldn't compile. Delphi insists that you either pass the exact object type or use a typecast. What I don't understand is the reason why Delphi is so strict here; if a class derives from tObject, it still has all the original stuff in place from its ancestor so you can't really "break" anything by treating it as a tObject, so why is Delphi so strict? It feels counter-intuitive. Type tBase=Class(tObject) procedure test; end; Procedure tBase.Test; begin // end; Procedure MyFreeAndNil(VAR obj: tObject); begin obj.free; obj:=Nil; end; procedure test; var t:tbase; begin t:=tbase.create; MyFreeAndNil(t); end;
-
Double, default value
A.M. Hoornweg replied to Skrim's topic in Algorithms, Data Structures and Class Design
Exactly. -
Double, default value
A.M. Hoornweg replied to Skrim's topic in Algorithms, Data Structures and Class Design
Just declare class procedure MyFormShow(Sender: TObject); STATIC; That way the method does not have a hidden "self" parameter. Having no "self" parameter turns the class method into a regular procedure inside the namespace tTest (it is no longer a "procedure of object"). Static class methods are unable to access any members or methods that require a "self" parameter. -
Double, default value
A.M. Hoornweg replied to Skrim's topic in Algorithms, Data Structures and Class Design
I for one would find it an advantage if stuff like local pointer variables would default to NIL, it would make the language just a little bit more memory safe. -
Double, default value
A.M. Hoornweg replied to Skrim's topic in Algorithms, Data Structures and Class Design
As far as I know, when an object is created all its members are filled with zero. And for stack variables, all managed types are filled with zero upon entry of a method. However, wouldn't it actually save CPU time if Delphi simply wiped the local variables area of the stack upon entry of a method (a known fixed number of bytes - a simple REP STOSD will do) instead of determining which local variables are managed types and then wiping those individually? -
tParallelArray and interfaces
A.M. Hoornweg replied to A.M. Hoornweg's topic in RTL and Delphi Object Pascal
This is a totally weird experience. Tuesday my compiler kept saying "There is no overloaded version of tParallelArray.For ... that can be called with these arguments" and I searched in vain for the cause. Then something came up and I had to abandon the project for a few days. Today I resumed working on it and it compiled just fine - I had changed nothing! I think that something got corrupted in the memory of the IDE process on Tuesday and the reboot just made it go away... I do have regular exceptions in the IDE since installing the inline update for 12.2 (build nr 29.0.53982.0329). Anyway, I'm thrilled that I can continue now. -
Hello all, just a short question: is System.Threading.tParallelarray not usable with interfaces? The following won't compile: Type iDownloadJob=Interface [{3d24b7a2-6111-46e7-a281-7fdc318be5c4}] procedure Download; end; procedure test; var x: array of iDownloadJob; temp:Integer; begin // ..... fill the array here .... temp:=tParallelArray.ForThreshold; tParallelArray.ForThreshold:=1; try tParallelArray.&For<iDownloadJob>(x, procedure (const AValues: array of iDownloadJob; AFrom, ATo: NativeInt) var i:NativeInt; begin for i:=AFrom to ATo do aValues[i].Download; end); finally tParallelArray.ForThreshold:=temp; end; end; It would be just my luck if such a nice new feature doesn't work for me 😞 .
-
Am I right that the the internal source code formatter is no longer there? It is still documented as a feature on Embarcadero's site though: https://docwiki.embarcadero.com/RADStudio/Athens/en/Source_Code_Formatter Is there a third-party formatter that handles generics correctly?
-
Code signing in a remotely working team?
A.M. Hoornweg replied to A.M. Hoornweg's topic in General Help
That's not what I read: "DigiCert KeyLocker is a cloud-based service that helps you generate and store the private key without a physical HSM (Hardware Security Module). It was developed to reduce certificate administrators’ efforts and strengthen private key security." (https://signmycode.com/blog/what-is-digicert-keylocker-everything-to-know-about) -
Code signing in a remotely working team?
A.M. Hoornweg replied to A.M. Hoornweg's topic in General Help
I'm very interested! -
Code signing in a remotely working team?
A.M. Hoornweg replied to A.M. Hoornweg's topic in General Help
The certificate is on the company name., having multiple ones would multiply the costs. I'm just reading up on Digicert Keylocker, which appears to be a cloud-based solution. If I understand correctly, Digicert keeps the USB device with the certificate and users can access it remotely. https://signmycode.com/blog/what-is-digicert-keylocker-everything-to-know-about https://www.digicert.com/blog/announcing-certcentrals-new-keylocker