Business Directory
Trade Forum
Vision 2000
Delphi
Domain Rates
Search
Music
Opinion Award
About
FeedBack
Quit


Delphi Bug List

| Tips & Tricks | Bug List | Cool Delphi Sites |
| Connectivity | Delphi 2.0 Features | Internet |

 Delphi Component Bugs

Dynamically created TComponent descendants will not paint in design-mode until the form is reloaded.
Real typed properties cause GPF in COMPLIB.DCL.


Dynamically created TComponent descendants will not paint in design-mode until the form is reloaded.

Description:
Non-visual components that are derived from TComponent and are created dynamically (e.g. not created by dropping them on the form) will not be painted on the form until it is reloaded. For example, consider that you design Component A to rely on Component B for some type of information or control. When an instance of Component A is dropped on a form, it must create Component B itself if there is not one already on the form. When Component B is created this way, it will not appear on the form until it is reloaded. Descendants of TComponent do not suffer from this problem.
Solution:
Don't derive your component from TComponent if it may be dynamically created by other components.

Real typed properties cause GPF in COMPLIB.DCL.

Description:
Adding a published property that is based on a variable of type Real causes Delphi to GPF. To illustrate the problem, install this example component and add it to a form:

unit RealBug;
interface
uses WinTypes, WinProcs, Classes, Controls, Forms;

type
TRealBug = class(TWinControl)
private
FVersion: Real;
published
Version: Real read FVersion write FVersion;
end;

procedure Register;

implementation

procedure Register;
begin
RegisterComponents('Bugs', [TRealBug]);
end;

end.
Solution:
From the Language Reference manual:

Furthermore, the type of a property defined in a published section must be an ordinal type, a real type (Single, Double, Extended, or Comp, but not Real), a string type, a small set type, a class type, or a method pointer type.

The solution is to use Single, Double, Extended, or Comp, whichever is most appropriate to your data. It would have been better for the compiler to generate an error when attempting to publish a real type property.

| Borland Delphi | About the Authors | Home |

For Queries Mail To Webmaster

Copyright © 1996 Asylum Software Pvt. Ltd. This is an ASPL production.
Produced in conjunction with ASPL DELPHI TEAM.
Last revised November 27, 1996.