Hallo
Ich finde den Fehler trotz diversen Bücher nicht.

Kann mir maljemand weiter helfen?
Ich habe ein Formular mit einem SortGrid (ähnlich StringGrid) und meine eigene Komponente SetiServ. Mein SortGrid habe ich im Objekt Inspektor bei meiner Komponente ausgewählt. Starte ich aber das Programm, ist der Wert von FSourceSortGrid NIL. Was mache ich falsch
Hier der komplete Code von SetiServ:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59:
| unit SetiServ;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Psock, SortGrid;
type TSetiServ = class(TNMGeneralServer) private { Private declarations } FSourceSortGrid:TSortGrid; protected { Protected declarations } public { Public declarations } constructor Create(AOwner: TComponent); override; procedure Serve; override; published { Published declarations } property SourceSortGrid: TSortGrid read FSourceSortGrid write FSourceSortGrid; end;
procedure Register;
implementation
procedure Register; begin RegisterComponents('Seti', [TSetiServ]); end; { TDateServ }
procedure TSetiServ.Serve; begin // if (Assigned(FSourceSortGrid)) then begin try FSourceSortGrid.SaveToFile('Seti.xls',';'); finally end; Application.ProcessMessages; try SendFile('Seti.xls'); finally end; end; end;
constructor TSetiServ.Create(AOwner: TComponent); begin inherited Create(AOwner); Port := 33333; end;
end. |
Danke...
