Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: W8111 Accessing deprecated entity '_fastcall TIdNotify::NotifyMethod()


This question is answered.


Permlink Replies: 7 - Last Post: Feb 15, 2018 5:33 PM Last Post By: erchuan zhao
erchuan zhao

Posts: 17
Registered: 2/18/16
W8111 Accessing deprecated entity '_fastcall TIdNotify::NotifyMethod()  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 10, 2018 6:27 PM
I got compiling warnings with the code calling to TIdNotify::NotifyMethod():

[bcc32 Warning] ServerMain.cpp(42): W8111 Accessing deprecated entity 'TIdNotify'
[bcc32 Warning] ServerMain.cpp(42): W8111 Accessing deprecated entity '_fastcall TIdNotify::NotifyMethod(TThreadMethod)'

Is there a substitution of the method?
Thanks~
Andy Walker

Posts: 72
Registered: 1/20/01
Re: W8111 Accessing deprecated entity '_fastcall TIdNotify::NotifyMethod()
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 11, 2018 3:21 AM   in response to: erchuan zhao in response to: erchuan zhao
erchuan zhao wrote:
I got compiling warnings with the code calling to TIdNotify::NotifyMethod():

[bcc32 Warning] ServerMain.cpp(42): W8111 Accessing deprecated entity 'TIdNotify'
[bcc32 Warning] ServerMain.cpp(42): W8111 Accessing deprecated entity '_fastcall TIdNotify::NotifyMethod(TThreadMethod)'

Is there a substitution of the method?
Thanks~

Hi,

From the IdSync.hpp file;

class PASCALIMPLEMENTATION TIdNotify _DEPRECATED_ATTRIBUTE1("Use static TThread.Queue()")  : public System::TObject


Does that help?

I haven't done much with Indy but that is suggesting you use a TThread instead of the Indy synchronisation classes.

Andy
erchuan zhao

Posts: 17
Registered: 2/18/16
Re: W8111 Accessing deprecated entity '_fastcall TIdNotify::NotifyMethod()  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 11, 2018 5:30 AM   in response to: Andy Walker in response to: Andy Walker
Andy Walker wrote:
erchuan zhao wrote:
I got compiling warnings with the code calling to TIdNotify::NotifyMethod():

[bcc32 Warning] ServerMain.cpp(42): W8111 Accessing deprecated entity 'TIdNotify'
[bcc32 Warning] ServerMain.cpp(42): W8111 Accessing deprecated entity '_fastcall TIdNotify::NotifyMethod(TThreadMethod)'

Is there a substitution of the method?
Thanks~

Hi,

From the IdSync.hpp file;

class PASCALIMPLEMENTATION TIdNotify _DEPRECATED_ATTRIBUTE1("Use static TThread.Queue()")  : public System::TObject


Does that help?

I haven't done much with Indy but that is suggesting you use a TThread instead of the Indy synchronisation classes.

Andy

Many thanks~
My code is:
TIdNotify::NotifyMethod(ShowDisconnectMessage);
The prototypes of static TThread.Queue() are as follows:
static void __fastcall Queue(TThread* const AThread, TThreadMethod AMethod)/* overload */;
static void __fastcall Queue(TThread* const AThread, _di_TThreadProcedure AThreadProc)/* overload */;
If I use TThread::Queue() method, which is the AThread parameter?
erchuan zhao

Posts: 17
Registered: 2/18/16
Re: W8111 Accessing deprecated entity '_fastcall TIdNotify::NotifyMethod()  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 11, 2018 6:07 AM   in response to: erchuan zhao in response to: erchuan zhao
erchuan zhao wrote:
Andy Walker wrote:
erchuan zhao wrote:
I got compiling warnings with the code calling to TIdNotify::NotifyMethod():

[bcc32 Warning] ServerMain.cpp(42): W8111 Accessing deprecated entity 'TIdNotify'
[bcc32 Warning] ServerMain.cpp(42): W8111 Accessing deprecated entity '_fastcall TIdNotify::NotifyMethod(TThreadMethod)'

Is there a substitution of the method?
Thanks~

Hi,

From the IdSync.hpp file;

class PASCALIMPLEMENTATION TIdNotify _DEPRECATED_ATTRIBUTE1("Use static TThread.Queue()")  : public System::TObject


Does that help?

I haven't done much with Indy but that is suggesting you use a TThread instead of the Indy synchronisation classes.

Andy

Many thanks~
My code is:
TIdNotify::NotifyMethod(ShowDisconnectMessage);
The prototypes of static TThread.Queue() are as follows:
static void __fastcall Queue(TThread* const AThread, TThreadMethod AMethod)/* overload */;
static void __fastcall Queue(TThread* const AThread, _di_TThreadProcedure AThreadProc)/* overload */;
If I use TThread::Queue() method, which is the AThread parameter?

I use NULL as the AThread parameter, it works, ok~
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: W8111 Accessing deprecated entity '_fastcall TIdNotify::NotifyMethod()  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 12, 2018 11:06 AM   in response to: erchuan zhao in response to: erchuan zhao
erchuan zhao wrote:

I use NULL as the AThread parameter, it works, ok~

Yes, that is what you should use.

--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: W8111 Accessing deprecated entity '_fastcall TIdNotify::NotifyMethod()
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 12, 2018 11:07 AM   in response to: erchuan zhao in response to: erchuan zhao
erchuan zhao wrote:

My code is:

TIdNotify::NotifyMethod(ShowDisconnectMessage);

The prototypes of static TThread.Queue() are as follows:

static void __fastcall Queue(TThread* const AThread, TThreadMethod
AMethod)/* overload */;

static void __fastcall Queue(TThread* const AThread,
_di_TThreadProcedure AThreadProc)/* overload */;

If I use TThread::Queue() method, which is the AThread parameter?

Use NULL, eg:

TThread::Queue(NULL, ShowDisconnectMessage);


--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: W8111 Accessing deprecated entity '_fastcall TIdNotify::NotifyMethod()
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 12, 2018 11:05 AM   in response to: erchuan zhao in response to: erchuan zhao
erchuan zhao wrote:

I got compiling warnings with the code calling to
TIdNotify::NotifyMethod():

In RAD Studio 10.2 Tokyo and later, and FreePascal 3.1.1 and later,
TIdNotify is deprecated, as it is just duplicating what
TThread::Queue() and TThread::Force() are already doing.

Is there a substitution of the method?

Use TThread::Queue() or TThread::ForceQueue().

TIdNotify is declared as 'deprecated' with a warning message that says
as much:

type
  ...
  TIdNotify = class(TObject)
    ...
  end
  deprecated 'Use static TThread.Queue() or TThread.ForceQueue()';


If the warning message is missing in the generated IdSync.hpp file,
that would be a Delphi HPP generation bug that Embarcadero needs to fix.

--
Remy Lebeau (TeamB)
erchuan zhao

Posts: 17
Registered: 2/18/16
Re: W8111 Accessing deprecated entity '_fastcall TIdNotify::NotifyMethod()  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 15, 2018 5:33 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
erchuan zhao wrote:

I got compiling warnings with the code calling to
TIdNotify::NotifyMethod():

In RAD Studio 10.2 Tokyo and later, and FreePascal 3.1.1 and later,
TIdNotify is deprecated, as it is just duplicating what
TThread::Queue() and TThread::Force() are already doing.

Is there a substitution of the method?

Use TThread::Queue() or TThread::ForceQueue().

TIdNotify is declared as 'deprecated' with a warning message that says
as much:

type
  ...
  TIdNotify = class(TObject)
    ...
  end
  deprecated 'Use static TThread.Queue() or TThread.ForceQueue()';


If the warning message is missing in the generated IdSync.hpp file,
that would be a Delphi HPP generation bug that Embarcadero needs to fix.

--
Remy Lebeau (TeamB)

Thanks, I get a lot.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02