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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:50:31+00:00 2026-05-23T01:50:31+00:00

There is a program and dll which the program uses (both are written on

  • 0

There is a program and dll which the program uses (both are written on Delphi and the code both is accessible).
In the program there is a procedure X, which deduces some statistics (on the timer), on the basis of interrogation of procedure Y from dll.
Procedure Y becomes more active at occurrence of some event in dll which can arise in different time intervals.

Question: whether it is possible to transfer in dll a name procedures X, and to execute it in procedure Y, to learn about arising events at once, instead of interrogating it on the timer.
Once again (or as a variant): how in the program to define, what in dll there was an event and to execute a code of procedure X?
If it is possible, a code example.

  • 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-23T01:50:32+00:00Added an answer on May 23, 2026 at 1:50 am

    If I understand your problem correctly, you’ve some code in an EXE and some more in a DLL. Every so often, a timer fires, which causes something to poll something else (not really clear on who’s polling what) to see if any work is available on one side, which the code on the other side can process. And you’d like to have a way for the one side inform the other side immediately when work is available, instead of having to wait on a timer.

    There’s a pretty well-established way to do this. The standard idiom to set this up in Delphi is with an event and an event handler. Here’s the basic idea:

    Let’s call the side that creates the data the Publisher, and the side that processes the work the Consumer. Give the Publisher object a variable of type TNotifyEvent. This is declared in the Classes unit as

    TNotifyEvent = procedure(Sender: TObject) of object;
    

    If that looks familiar, it’s because a good percentage of VCL event handlers, such as TButton.OnClick, are of type TNotifyEvent. If you want to pass some more useful data in the event, you can declare your own event type instead. For example:

    TDataReadyEvent = procedure(data: TStatisticalData) of object;
    

    Put a variable of your event handler type on the Publisher (FOnDataReady: TDataReadyEvent;) and create a property that exposes it. Then add some code to fire the event. Somewhere in the Producer, you have code that produces new data to be analyzed. Right after that finishes, add something like this:

    if assigned(FOnDataReady) then
      FOnDataReady(NewData);
    

    Then, on the Consumer, create a method whose signature matches the event handler type. It should be able to process the data. To link them together, do something like this in your initialization code for the Consumer:

    Producer.OnDataReady := self.HandleDataReady;
    

    And there you have it! It’s really that simple. Now your Consumer will be automatically invoked whenever new data is available from the Producer, without having to use a timer and continually poll the Producer asking if it’s got anything yet.

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

Sidebar

Related Questions

i have a .net dll which is written in c sharp, which uses linq
I'm writing a DLL which a java program uses to call the WinAPI in
I have a Delphi 2007 Program, which calls a Delphi 2010 DLL. The Program
Is there a program or API I can code against to extract individual files
Is there a way (a program, a library) to approximately know which language a
There's a class which is compiled into a dll //HeaderFile.h //version 1.0 class __declspec(dllexport)
Is there a program that will print a nicely formatted tree from XML data?
I have been working on a childish little program: there are a bunch of
I've had a tough time setting up my replication server. Is there any program
There's this program, pdftotext, that can convert a pdf file to a text file.

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.