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

  • Home
  • SEARCH
  • 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 6538137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:42:03+00:00 2026-05-25T10:42:03+00:00

I am attempting to convert a GUI application that I made in Delphi (actually,

  • 0

I am attempting to convert a GUI application that I made in Delphi (actually, its Lazarus) to a library(DLL).

In the GUI application I used a OnDataChange event listener, but I cannot seem to figure out how to do the same thing for the library.

Here is what it looks like in the GUI App:

procedure TForm1.Datasource2DataChange(Sender: TObject; Field: TField);
begin
  ZMakeRankedTable.Close;
  GetNN;
end;  

And in the unit’s LFM file:

object Datasource2: TDatasource
DataSet = ZMakeRankedTable
OnDataChange = Datasource2DataChange
left = 184
top = 95
end       

How do I do the same thing for the library? Where do I initialize the event listener?

  • 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-25T10:42:04+00:00Added an answer on May 25, 2026 at 10:42 am

    What is wrong with creating a new class of your own that will be the delegate, instead of a form:

    type
      TDataDelegate = class
      public
        procedure DataChange(Sender: TObject; Field: TField);
        etc...
      end;
    
    procedure TDataDelegate.DataChange(Sender: TObject; Field: TField);
    begin
      // Do what you normally would do in your form's event handler
    end;
    

    And just be sure to create an instance of the class

    DataDelegate := TDataDelegate.Create;
    DataSource2.OnDataChange := DataDelegate.DataChange;
    

    etc…

    In other words, instead of a form, use a class you wrote to handle the events of the various classes. Like in a form, each of the procedures should have the signature of the event handler. The only difference is that the IDE won’t create these methods for you.

    You could also use a TDataModule, I guess, but I am not sure about the implications. The advantage would be IDE support.

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

Sidebar

Related Questions

In my service layer for my MVC application I am attempting to convert the
I have an application I am attempting to convert from a flex 3 air
I'm attempting to convert a Python application I coded using the cmd module into
I have been exploring the json library , and am attempting to convert an
I have an existing drop down menu that I am attempting to convert to
I have a NSSlider that is attempting to convert a regular float into a
I'm attempting to convert my script that I use for registering a user on
I am attempting to convert a bing map implementation that uses standard PushPins in
I'm attempting to convert a C header into a Python library using ctypes and
I am attempting to use GhostScript 9.04 with .NET (gsdll32.dll) to convert and then

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.