Ver Mensaje Individual
  #7  
Antiguo 20-12-2005
Avatar de Ohcan
[Ohcan] Ohcan is offline
Miembro Premium
 
Registrado: ago 2004
Ubicación: Madrid (España)
Posts: 119
Reputación: 20
Ohcan Va por buen camino
Arrow Un ejemplo significado

Bueno... me he creado un ejemplo simplificando:
Código Delphi [-]
unit Unit2;

interface
 
uses Classes, StdCtrls, SysUtils, Dialogs;
 
type
  TMiCombo = class(TComboBox)
    FItems:TStringList; 
  published
    property Items:TStringList read FItems;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation

{ TMiCombo }

constructor TMiCombo.Create(AOwner: TComponent);
begin
  inherited;
  FItems := TStringList.Create;
end;

destructor TMiCombo.Destroy;
var
  i:integer;
begin
  if FItems<>nil then
  for i:= 0 to Self.Items.Count-1 do
    begin
      Items.Objects[i].Free; 
      Items.Objects[i] := nil;
    end;
  inherited Destroy;
end;

end.
Y cuando creo el objeto:
Código Delphi [-]
MiCombo := TMiCombo.Create(Self);
MiCombo.Parent := Self;
Si quito lo que está marcado en rojo... me da el mismo error que en tu código...
Espero que te sirva de pista
Ya nos contarás...
__________________
La violencia es el último recurso del incompetente. (Salvor Hardin)
Responder Con Cita