Ver Mensaje Individual
  #1  
Antiguo 13-01-2005
pepe2000 pepe2000 is offline
Miembro
 
Registrado: dic 2003
Ubicación: Cajamarca
Posts: 93
Reputación: 21
pepe2000 Va por buen camino
Unhappy Access Violation al cargar un Tbitmap en mi componente

Ya estoy 3 horas intentando solucionar este problema que deberia ser simple, pero a mi no me funciona.
Al colocar siguiente componente en un formulario e intentar cargar una imagen en el sale un error de "access violation".
Les agradezco mucho su ayuda.
Código:
unit prueba;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  db;


type
  Tprueba = class(Tcomponent)
  private
    { Private declarations }
    Fglyph: Tbitmap;
    procedure SetBitmap(const Value: TBitmap);
  protected
    { Protected declarations }
  public
    { Public declarations }
    constructor create(AOwner: Tcomponent); override;
  published
    { Published declarations }
    property Glyph: TBitmap       read FGlyph write SetBitmap;
  end;

procedure Register;

implementation

uses pmemose1;

constructor Tprueba.create(AOwner: Tcomponent);
begin
   inherited create(AOwner);
end;

procedure Tprueba.SetBitmap(const Value: TBitmap);
begin
   FGlyph.Assign(Value);
end;

procedure Register;
begin
  RegisterComponents('Samples', [Tprueba]);
end;

end.
Responder Con Cita