Ross

Others have replied and pointed out the method (same as a TDatasource and
TDataSet link)
Also you should override

    procedure Notification(AComponent: TComponent; Operation: TOperation);
override;

which is called when a component instance is destroyed (so that you can
clear your pointer and
not leave it 'dangling'), For consistency you should also call
TComponent.FreeNotification to
make sure you are notified of destruction (if the component you are linked
to has a different owner)

HTH

Neven

----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Tuesday, November 11, 2003 9:47 PM
Subject: [DUG]: Basic question on custom components


> Hi, I'm trying to write my first custom component and have come across a
> problem I'm positive it's common and easy to solve - but I'm not familiar
> with how.
>
> I have a form with an existing custom component on it (written in the past
> by someone else). The form resides in MainUnit.pas and the existing custom
> component resides in UVObject.pas. I've created a new component with the
> class residing in TableObject.pas.
>
> From an instance of my new component (TUVTable, dropped on the form), I
need
> to call methods of the instance of the TUVObject component on my form. In
> TUVTable.pas I could add a uses clause, MainUnit, and then call
> MainUnit.UVObject1.method - so allowing communication between the 2
> component instances. This is silly as if the user of my component has
named
> their unit something other than MainUnit, then it won't work.
>
> How do I enable intercommunication between 2 component instances on my
form?
>
> Thanks for the help.
>
> Cheers,
> Dave
>
>
> Dave Jollie
> Developer, TOWER NZ IT
> *
> *: 09 368 4259
> *: 09 306 6801
> *: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
> *: 46 Parnell Rd, Parnell, Auckland
>
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to