Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-06

Problem streaming properties without unit interfaces

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Joost van der Sluis

Hi all,

It seems like it that streaming properties referencing to objects on other datamodules does not work without the unit interfaces.

For example, you have two datamodules, on one you define a TIBConnection, and on the other a TSQLQuery. Now set the Database property of the TSQLQuery to the TIBConnection on the other datamodule.

At runtime the Database property will be nil, if the unit interfaces is not linked in. When you use the interfaces unut somewhere, it works.

Why? How? Any ideas where this comes from?

Joost

Reply by email

Mattias Gaertner
to Joost van der Sluis
Show quoted text 15 lines
Hi all, It seems like it that streaming properties referencing to objects on other datamodules does not work without the unit interfaces. For example, you have two datamodules, on one you define a TIBConnection, and on the other a TSQLQuery. Now set the Database property of the TSQLQuery to the TIBConnection on the other datamodule. At runtime the Database property will be nil, if the unit interfaces is not linked in. When you use the interfaces unut somewhere, it works. Why? How? Any ideas where this comes from?

Components are found by the FindGlobalComponent function of unit classes.
TApplication registers one event in its constructor:

  RegisterFindGlobalComponentProc(@FindApplicationComponent);

It searches in Application and Screen.

You can register your own handler to find more.

AFAIK: Delphi has the same mechanism.

Mattias

Reply by email