Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7680729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:10:56+00:00 2026-05-31T18:10:56+00:00

Virtual method interception – introduced with Delphi XE – can be used to ‘proxify’

  • 0

Virtual method interception – introduced with Delphi XE – can be used to ‘proxify’ methods so that custom code can be executed before and after the original method.

Could this also be used to keep a count of all object instances in a Delphi application, by proxyfying the virtual methods TObject.AfterConstruction and TObject.BeforeDestruction?

If yes, this could be a simple way to analyse FastMM4 memory allocation statistics at run time (using the InstanceSize property of objects and matching it against the allocated memory blocks).


Update: sorry for asking a question which was very easy to answer from the DocWiki information – I have read the linked article first and only skimmed the example code

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T18:10:57+00:00Added an answer on May 31, 2026 at 6:10 pm

    No, that’s not going to work. From the documentation, with my emphasis:

    Permits the user to dynamically intercept virtual method calls on specified instances of a particular class type.

    The problem is that you need to get hold of each and every instance before you can proxify. But you are hoping to proxify in order to get hold of instances. So you are now caught in a chicken and egg scenario.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that calling a virtual method from a base class constructor can be
Can I execute the body of a virtual method that lives on an abstract
Here's my problem: I have a virtual method defined in a .h file that
I have a base class with a virtual method, and multiple subclasses that override
I have an abstract class that has a virtual method. The method is virtual
In C#, a virtual method of base class can be either overridden or hidden
I have some code where I really want to call a virtual method from
Is there any way to override a non-virtual method? or something that gives similar
When implementing polymorphic behavior in C++ one can either use a pure virtual method
I have an existing class that declares a virtual method and defines a default

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.