Ver Mensaje Individual
  #3  
Antiguo 23-11-2011
kdemia kdemia is offline
Miembro
 
Registrado: may 2010
Posts: 109
Reputación: 14
kdemia Va por buen camino
El error es :

Cita:
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address 004B5657 in module 'Project1.exe'. Write of address 00000008'.
Igualmente el metodo create esta demas, era para ver si el problema se encontraba en la asignacion esa.. pero no tendria porque pasar, osea si hago una cola de manera procedural funciona perfectamente, el problema esta en hacerlo en poo.

Igualmente tmb dejo el codigo del Form principal.

Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Cola, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  Cola : TCola;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Cola.Push(Edit1.Text);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  ShowMessage(Cola.Pop);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Cola.Create;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  Cola.Free;
end;

end.

Última edición por kdemia fecha: 23-11-2011 a las 23:53:41.
Responder Con Cita