The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for the ‘Delphi’ Category

When I ever go and use the Spring4D activator, these are some URLs I need to re-read

Posted by jpluimers on 2019/03/27

When I ever go and use the Spring4D activator, these are some URLs I need to re-read:

–jeroen

Posted in Delphi, Development, Software Development, Spring4D | Leave a Comment »

Are these really Windows compiler unsupported Delphi Intrinsic Routines?

Posted by jpluimers on 2019/03/19

Odd, the [WayBack/Archive.is] Delphi Intrinsic Routines – RAD Studio indicates quite a few compiler intrinsics are not available on Windows.

I wonder if this list is correct:

Routine Description DCC32 DCC64 DCCOSX DCCAARM DCCIOSARM DCCIOSARM64 DCCIOS32
System.AtomicCmpExchange AtomicCmpExchange is used for comparing and exchanging memory values. Allowed.png Allowed.png Allowed.png Allowed.png
System.AtomicDecrement AtomicDecrement is used for decrementing memory values. Allowed.png Allowed.png Allowed.png Allowed.png
System.AtomicExchange AtomicExchange is used for exchanging memory values. Allowed.png Allowed.png Allowed.png Allowed.png
System.AtomicIncrement AtomicIncrement is used for incrementing memory values. Allowed.png Allowed.png Allowed.png Allowed.png
System.BuiltInArcTan Calculates the arctangent of a given number. Allowed.png Allowed.png
System.BuiltInArcTan2 Calculates the arctangent angle and quadrant of a given number. Allowed.png Allowed.png
System.BuiltInCos Calculates the cosine of an angle. Allowed.png Allowed.png
System.BuiltInLn Calculates the natural logarithm of a real expression. Allowed.png Allowed.png
System.BuiltInLnXPlus1 Calculates the natural logarithm of (X+1). Allowed.png Allowed.png
System.BuiltInLog10 Calculates log base 10. Allowed.png Allowed.png
System.BuiltInLog2 Calculates log base 2. Allowed.png Allowed.png
System.BuiltInSin Calculates the sine of the angle. Allowed.png Allowed.png
System.BuiltInSqrt Calculates the square root of X. Allowed.png Allowed.png
System.BuiltInTan Calculates the tangent of X. Allowed.png Allowed.png

Especially since this compiles fine with the DCC32 compiler:

program CompilerIntrinsicsConsoleProject;

{$APPTYPE CONSOLE}

{$R *.res}

var
  I, J, K: Integer;
begin
  System.AtomicCmpExchange(I, J, K);
  System.AtomicDecrement(I);
  System.AtomicExchange(I, J);
  System.AtomicIncrement(J);
end.

–jeroen

Posted in Delphi, Delphi 10.3 Rio (Carnival), Development, Software Development | 3 Comments »

delphi – Why was TDataSource created originally? – Stack Overflow

Posted by jpluimers on 2019/03/14

From a while ago [WayBackdelphi – Why was TDataSource created originally? – Stack Overflow

5down voteaccepted

It is all about decoupling and indirection.

And with TDataSource there are two kinds of them:

  • Decoupling the master detail relations (TDataSource is in the same module as the TDataSets that are being bound; the detail TDataSet references the master TDataSet by pointing its’ MasterSource property to the TDataSource that points to the master TDataSet)
  • Decoupling the UI from the business layer (TDataSets are in a DataModule; TDataSource is on the Form/Frame which contains your UI controls, UI controls reference their DataSourceproperty).

Since many components can point to the same DataSource, you can quickly switch which underlying TDataSet they use by just flipping one TDataSource.DataSet property.

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | Leave a Comment »

Link archive: to investigate – Classic compiler (Win32) strings double-free crash because of error in refere…

Posted by jpluimers on 2019/03/12

For my link archige: [WayBack] Classic compiler (Win32) strings double-free crash because of error in reference-counting. Tested with XE2 and 10.1 Berlin Test applications: https://g… – Arioch The – Google+

–jeroen

Posted in Delphi, Development, Software Development | 3 Comments »

IDE Fix Pack 6.4 for Delphi 2009,XE-10.2 Tokyo and 6.4.1 for Delphi 2010 and 10.3 Rio

Posted by jpluimers on 2019/03/12

On my list of things to install soon IDE Fix Pack 6.4 and 6.4.1:

Technically, there is 6.4 that works in Delphi 10.3 Rio Update 1, but it is better to install 6.4.1 as it works with 10.3 and 10.3.1:

The dependencies file looks interesting for good uses list optimisation, given that you compile with all conditional define permutations:

There is a ton of changes, of which I like the bold ones most:

6.4

  • Fixed: Packages with duplicate units may not have caused a fatal compiler error.
  • Added: Support for Delphi 10.3 Rio
  • Added: StyleUtils.inc performance optimizations for faster UI rendering (D10.3)
  • Added: Infinite loop detection in TDebugger.UpdateEventLog
  • Added: Fix for TStringList.IndexOfName bug (RSP-21633)
  • Added: Fix for access violation in the Welcomepage JScript9.dll binding
  • Added: TCustomListBox.ResetContent is skipped if the handle isn’t created yet
  • Added: More STRINGCHECKS-free RTL code (2009/2010)
  • Added: More DFM Streaming optimizations
  • Added: RTL and DFM streaming patches to remove STRINGCHECKS (2009/2010)
  • Added: Removed VclFixPack OutputDebugString calls (2009)
  • Added: FillChar uses Enhanced REP MOVSB/STOSB cpu feature if available for large sizes.
  • Added: Enabled CPU LOCK string assignment optimization for local variables
  • Added: -x-Oe (experimental optimizations) and -x-cgo compiler option extension
  • Added: CodeGen: Remove of some unnecessary push/pop operations
  • Added: Expression Evaluator allows array access to pointers even if the type wasn’t declared with {$POINTERMATH ON}
  • Added: Max number of constants in a function was increased from 64K to 16M (2009-XE3)
  • Added: New compiler option extensions: -x–compileonly, -x–reslist, -x–depfile, -x–unitstats
  • Added: More performance optimization for the DCC64 compiler
  • Added: TStringBuilder.SetLength optimization [RSP-19178] (XE+)
  • Added: TStrings.GetDelimitedText optimization
  • Improved: Slight faster TStringList.IndexOfName optimization for sorted string lists.

6.4.1

  • Fixed: StyleUtils.inc patch contained a hard coded address causing the patch to fail if the DLL’s base address was relocated. (10.3 only)
  • Fixed: TCustomListBox.ResetContent patch crashed with an access violation. (2010 only)

–jeroen

Read the rest of this entry »

Posted in Delphi, Development, Software Development | Leave a Comment »

Smart Pointers code that compiles in FPC and Delphi

Posted by jpluimers on 2019/03/06

Delphi and FPC have different language boundaries, so it is always good to read a thread discussing how to get near-the-edge cases work in both.

This case is about Smart Pointers (here called auto pointers, maybe because auto_ptr is what they used to be called in C++): [WayBack] Hi all, I am trying to make a certain piece of code cross compile between Delphi and FPC. On FPC, it compiles fine but on Delphi I get a [dcc32 Error] P… – Ugochukwu Mmaduekwe – Google+

In the end if comes down to that Delphi does not allow forward-declaration of records (it does for interfaces and classes), but that you do not need a __PAutoPtr_T = ^__TAutoPtr_T, because you can use ^__TAutoPtr_T in parameters.

In Spring4D, they are called Shared/IShared/TShared, see my comment:

Note that since these are reference counted, you might want to call them shared_ptr. If you enforce the single-instance behaviour, observe that in C++ they are now called uniqe_ptr.

In Spring4D this rename has already taken place a while ago: https://bitbucket.org/sglienke/spring4d/commits/e252b81fd3788cf5b82588721f68d00c892deb87

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 2 Comments »

My contributions to RAD Studio – Jose León – Medium

Posted by jpluimers on 2019/02/28

For my link archive, as a reminder to check the Sistel JIRA tool, which is an IDE like tool for JIRA: [WayBack] Business Process Studio for JIRA | Sistel

He has some very interesting posts at [Archive.isJose León – Medium.

Via:

–jeroen

Read the rest of this entry »

Posted in Delphi, Development, Issue/Bug tracking, JIRA, Software Development | Leave a Comment »

Anyone who knows about http://sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RADStudio_Rio ?

Posted by jpluimers on 2019/02/28

It look likes sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RADStudio_Rio is gone (though docwiki has more than a couple 100 mentions of [Archive.is] “radstudiodemos” and [Archive.is] “RADStudio_Rio”), for instance here:

I have not seen an announcement of this branch disappearing, so I wonder what happened and why.

sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches was a great resource, as it had a consistent history from Delphi XE through 10.2 Tokyo (apparently there used to be 10.3 Rio too) that made it very easy to see the differences in various versions, giving a great indication of new features and differences in products, often before the docwiki got updated to reflect them.

SVN not being centralised, now makes this chain break for Delphi 10.3 Rio, which is quite a pity.

If anyone has the complete SVN history including Delphi 10.3 RIO, please let me know: Delphi 10.3 Rio Update 1 now finally being out likely means many more people start using it as initial issues found in the public have been fleshed out.

It would have been so much more convenient to have for instance a git converted repository keeping all the history and including Delphi 10.3 Rio somewhere.

If anyone has that, I’d be interested in that too. One can dream, right?

Sidenote

I bumped into this via a link pointing to URLs having these fragments in them, which are now invalid:

This means I have to fix some 150 links later: [Archive.is] site:wiert.me “radstudiodemos” – Google Search.

It looks like radstudiodemos.svn.sourceforge.net/svnroot/radstudiodemos/trunk got replaced with sourceforge.net/p/radstudiodemos/code/HEAD/tree/trunk and https://svn.code.sf.net/p/radstudiodemos/code/trunk, which should give me a head-starting on how to fix the links.

–jeroen

 

 

Posted in Delphi, Delphi 10.3 Rio (Carnival), Development, Software Development | 1 Comment »

There can be only MS Office sample automation server wrapper components in RAD Studio

Posted by jpluimers on 2019/02/27

There are six variations; only one can be active at a time:

  • Delphi Office 2000 Servers Package
  • Delphi Office XP Servers Package
  • Delphi Office 2010 Servers Package
  • C++Builder Office 2000 Servers Package
  • C++Builder Office XP Servers Package
  • C++Builder Office 2010 Servers Package

via: I cannot get MS Office sample automation server wrapper components. Neither of… [WayBack]

More in depth article explaining all the nitty gritty details: There Can Only Be One! Handling Different Versions of Design Packages inside the IDE | The Art of Delphi Programming [WayBack]

–jeroen

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »

Did you know? 10.2 Tokyo has introduced 3 new warnings for Delphi compilers:…

Posted by jpluimers on 2019/02/27

Seems I forgot to push the “publish” button on this 2 years ago (:

Did you know?

10.2 Tokyo has introduced 3 new warnings for Delphi compilers:

Implicit integer cast with potential data loss from ‘<from>’ to ‘<to>’ W1071 IMPLICIT_INTEGER_CAST_LOSS Default: Off
Implicit conversion may lose significant digits from ‘<from>’ to ‘<to>’ W1072 IMPLICIT_CONVERSION_LOSS Default: Off
Combining signed type and unsigned 64-bit type – treated as an unsigned type W1073 COMBINING_SIGNED_UNSIGNED64 Default: On

Source: [WayBack] Did you know? 10.2 Tokyo has introduced 3 new warnings for Delphi compilers:…

Comment:

they were initially documented in less detail than the above table, and it keeps surprising me that you need to read employee blogs instead of the docwiki to keep current: [WayBack] New Warnings, Illegal Casts, and other Delphi compiler changes in 10.2 Tokyo.

Since then, documentation has improved to this:

Read the rest of this entry »

Posted in Delphi, Development, Software Development | Leave a Comment »