🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.comp.lang.borlanddelphi
2 messages
2 total messages Started by Christopher Voth Wed, 16 Feb 2000 00:00
Adding non-visual components to DLLs
#3
Author: Christopher Voth
Date: Wed, 16 Feb 2000 00:00
6 lines
1607 bytes
Hello
I want to add a non-visual component to a DLL.  Can anyone tell me how to do
this and assign event handlers.  I am having trouble doing this without the
object inspector and a form to drop it onto.
Thank you
Chris
Re: Adding non-visual components to DLLs
#2
Author: J.B
Date: Wed, 16 Feb 2000 00:00
31 lines
2486 bytes
Just declare the object you want to add, and create it,
for instance, if you you have a procedure called MyProc, you want to create a TTable inside it, and assign to the
BeforePost event, do it as follows:

Procedure MyProc (event : TEventNotify);
Var
  MyTable : TTable
Begin
  MyTable := TTable.Create(Application);
  Try
    MyTable.BeforePost := event;
  Finally
    MyTable.Free //I have to free it here,
                          // since I don't have any refernce to it out side the proc  !!!
  End;
End;

If you need the ttable outside the proc, define it BEFORE the proc, and free it when you need to free it (like ..., on
finalization of a DLL)
hope that helps
JB


Christopher Voth wrote:

> Hello
> I want to add a non-visual component to a DLL.  Can anyone tell me how to do
> this and assign event handlers.  I am having trouble doing this without the
> object inspector and a form to drop it onto.
> Thank you
> Chris
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads