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 6100689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:24:57+00:00 2026-05-23T13:24:57+00:00

Does anyone here know how Delphi represents a reference to procedure? for example var

  • 0

Does anyone here know how Delphi represents a reference to procedure?

for example

var
  proc: TProc;
...
proc = procedure begin beep end;

What do we got in “proc”?

I know that for “method variable” the memory representation is 4 bytes for the “procedure address” followed by 4 bytes for the “object address”, but for “reference to procedure” is somewhat different and I cannot quite figure it out.

The reason I want this is because I have some legacy code that I want to make it work with references.

Does anyone know something about it?

  • 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-23T13:24:57+00:00Added an answer on May 23, 2026 at 1:24 pm

    Method references are implemented as a COM-style interface with a single method called Invoke, which has the same signature as the method reference.

    So TProc looks like this:

    type
      TProc = interface(IInterface) // so inherits QI, AddRef, Release
         procedure Invoke;
      end;
    

    It’s a valid question to ask, as Delphi has interoperability with the C++ product. By using a pre-existing reference-counted type and idiom (COM lifetime rules), interop with C++ at the method reference level is possible.

    Anonymous methods generate a hidden class which implements an interface isomorphic to the method reference interface, i.e. exactly the same shape, but not with the same symbolic identity. The hidden class doesn’t implement the method reference interface directly because it may need to implement the interface multiple times (a single block may contain multiple anonymous methods all assigned to locations of the same method reference type).

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

Sidebar

Related Questions

Does anyone here know SVG? If so, how did you learn it? Any books/tutorial
Does anyone here use Spec# regularly? I would like to know if it is
Does anyone know how to change the Bordercolor for a Datagridviewcell in c#? Here's
Does anyone here know how i can determine the version of SQL running on
Does anyone here use VB.NET and have a strong preference for or against using
Does anyone here has any experience on how to send HTML emails that renders
Does anyone have experience using the URL Rewrite Module (see here )? Can it
See here: http://code.google.com/p/ie7-js/ Does anyone have any experience or remarks about this javascript? Is
Does anyone know how to get IntelliSense to work reliably when working in C/C++
Does anyone know the specifics of how to embed the Mono runtime in a

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.