Search code examples
delphidelphi-7delphi-xe4

W1000 Symbol 'THintInfo' is deprecated compiler warning in Delphi XE4


In my Delphi 7 code, following procedure is declared.

procedure MyProcedure(var HintInfo: THintInfo);

While migrating it to Delphi XE4, compiler throws following warning:

W1000 Symbol 'THintInfo' is deprecated: 'Use Vcl.Controls.THintInfo'

I googled and found following solution at http://www.alphaskins.com/forum/index.php?showtopic=5005

{$IFDEF UNICODE}
THintInfo = Controls.THintInfo;
{$ENDIF}

Is it right or is there any efficient way to do this.

I have Controls unit added already in my uses.


Solution

  • What has happened is that the definition of the type has been moved from Forms to Controls. Embarcadero have left a definition in the Forms unit which refers to the real one in Controls, and marked that definition in Forms as being deprecated.

    The compiler warning tells you what to do it says:

    Use Vcl.Controls.THintInfo
    

    Now, since you are importing Controls rather than Vcl.Controls, taking advantage of the unit scope names that you have defined, you need to name this symbol as

    Controls.THintInfo
    

    Personally I would much prefer it if Embarcadero had just remove the definition from Forms when they moved it to Controls. They don't like to break compilation when upgrading, but who imports Forms and not Controls? And instead everyone has to face the deprecation warning and are left having to deal with it. I believe that Embarcadero's chosen path leads to a greater impact on users than simply moving the declaration would have done.