Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TUpDown component OnChangingEx change from XE2 to XE7


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Feb 13, 2015 11:08 AM Last Post By: Alan Marryat
Alan Marryat

Posts: 28
Registered: 3/14/01
TUpDown component OnChangingEx change from XE2 to XE7  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 13, 2015 8:25 AM
Does anyone know when the event handler changed for this?

This caused me trouble, because the compiler didn't catch the error when recompiling. I just happened to find it.

In XE2

procedure TConfigurationDlg.StorageIntervalUpDown_XLSChangingEx(Sender: TObject; var AllowChange: Boolean; NewValue: Smallint; Direction: TUpDownDirection)

Notice the NewValue is a Smallint.

In XE7

procedure TConfigurationDlg.StorageIntervalUpDown_XLSChangingEx(Sender: TObject; var AllowChange: Boolean; NewValue: Integer; Direction: TUpDownDirection);

Notice that NewValue is an Integer

When did this change?
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: TUpDown component OnChangingEx change from XE2 to XE7  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 13, 2015 10:10 AM   in response to: Alan Marryat in response to: Alan Marryat
Alan wrote:

Does anyone know when the event handler changed for this?

It was changed in XE5.

--
Remy Lebeau (TeamB)
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: TUpDown component OnChangingEx change from XE2 to XE7  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 13, 2015 10:17 AM   in response to: Alan Marryat in response to: Alan Marryat
Alan Marryat wrote:

Does anyone know when the event handler changed for this?

XE5, that was the first version using integer.


This caused me trouble, because the compiler didn't catch the error
when recompiling. I just happened to find it.

In XE2

procedure
TConfigurationDlg.StorageIntervalUpDown_XLSChangingEx(Sender:
TObject; var AllowChange: Boolean; NewValue: Smallint; Direction:
TUpDownDirection)

Notice the NewValue is a Smallint.

In XE7

procedure
TConfigurationDlg.StorageIntervalUpDown_XLSChangingEx(Sender:
TObject; var AllowChange: Boolean; NewValue: Integer; Direction:
TUpDownDirection);

Notice that NewValue is an Integer

When did this change?


--
Peter Below (TeamB)

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: TUpDown component OnChangingEx change from XE2 to XE7  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 13, 2015 10:47 AM   in response to: Alan Marryat in response to: Alan Marryat
Alan wrote:

This caused me trouble, because the compiler didn't catch the error
when recompiling.

It is not a compiler issue, it is an IDE issue. Event handlers assigned
via DFM streaming at design-time and run-time are assigned based on name
lookup only, parameters are not validated. The IDE cannot validate a pre-existing
event handler assignment. It can perform validation only when assigning
a new handler to an event. The compiler is not involved in any of that.
The compiler can only validate event handlers that are assigned in code.

In fact, it is that very IDE limitation that caused a major AnsiString/UnicodeString
compatibility issue in C++Builder when the RTL/VCL first switched to Unicode.
When migrating a C++ project from an earlier C++Builder version to the CB2009
IDE, pre-existing C++ event handlers assigned to Delphi-written components
that had AnsiString input parameters would receive Unicode data payloads
from the Delphi side, and AnsiString output parameters would send Ansi payloads
back to UnicodeString variables on the Delphi side. To account for that,
a STRINGCHECKS option had to be added to the Delphi compiler and RTL source
code, which allowed AnsiString to hold Unicode payloads and UnicodeString
to hold Ansi payloads, and implicit payload conversions would be performed
as needed during string assignments. Needless to say, that caused some major
headaches and overhead for C++ users (Delphi users were not affected). That
functionality was eventually removed in XE, though. IIRC, I think the IDE
was eventually updated to validate an existing event handler signature at
design-time when saving a project, but I forget when that was added.

--
Remy Lebeau (TeamB)
Alan Marryat

Posts: 28
Registered: 3/14/01
Re: TUpDown component OnChangingEx change from XE2 to XE7  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 13, 2015 11:08 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thanks for the answers.

I only found the change when I opened that particular form in the IDE and it alerted me to the error.

I wonder if I should go open every file in every project to make sure there aren't any other similar changes that have occurred between XE2 and XE7.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02