Cześć, mam problem. Tworzę sobie nowy komponent dziedziczący po TWinControl.
Deklaracja konstruktora wygląda tak:
constructor Create(AOwner: TComponent); override;
a konstrulktor wygląda tak:
inherited Create(AOwner);
FParentWidth:=Parent.Width;
FPosition:=0;
FMove:=0;
FActive:=false;
FText:=Name;
FTransparent:=true;
FTimerInterval:=1000;
FTimer.Create(nil);
FTimer.Interval:=FTimerInterval;
FTimer.Enabled:=false;
FTimer.OnTimer:=TimerExecution;
FFont:=TFont.Create;
FFont.Color:=clBlack;
FFont.Name:='Arial';
FFont.Size:=10;
FBitmap:=TBitmap.Create;
FBitmap.Canvas.Font.Assign(FFont);
FBitmap.Canvas.Brush.Style:=bsClear;
FBitmap.Canvas.TextOut(0, 0, FText);
FCanvas:=TCanvas.Create;
FCanvas.Handle:=GetDC(Handle);
FCanvas.Draw(Left, Top, FBitmap);
<delphi>
Podczas kładzenia komponentu na formę dostaję AccessViolation... Co może być nie tak?
</delphi>