[EMAIL PROTECTED] wrote:

<snip>
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.

Stacey's answer is the normal method, and it's a good one. It basically creates a link between the two components, which is much more generic than linking to the other object statically or trying to find it at runtime. Same as linking a TDBGrid to a TDataSource.


One other option, although it's not a terribly good one, is to iterate the components on the form and find the one with the correct type. TObject.TypeName or something similar will work for that.

Probably better to do it the classic way though :>

--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"

---------------------------------------------------------------------------
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