Ir al contenido


Foto

mensaje de error, No existe un componente llamado ...


  • Por favor identifícate para responder
4 respuestas en este tema

#1 FGarcia

FGarcia

    Advanced Member

  • Miembro Platino
  • PipPipPip
  • 687 mensajes
  • LocationMéxico

Escrito 29 marzo 2014 - 01:40

Saludos antes que nada! 

Estoy usando Windows 7 Pro 64 Bits, CodeTyphon 4.70 IDE 32.

Llevo tiempo fuera de Lazarus y ahora que lo retome tengo algunos problemas con un componente para la comunicación serial (CPortLib para Lazarus), les cuento que he instalado correctamente el componente en Lazarus, sin embargo cuando hago uso del formulario de configuración de baudios, puerto y demás me envía un error;

[Window Title]
Error

[Content]
El proyecto CapturaPeso ha lanzado una excepción de la clase 'External: SIGSEGV'.

En archivo 'CPortCtl.pas' en linea 801

[Aceptar]

Cuyo codigo es:



delphi
  1. // set ComPort property
  2. procedure TComComboBox.SetComPort(const Value: TCustomComPort);
  3. begin
  4.   if FComSelect.ComPort <> Value then  [b]//Aqui se genera el ERROR: "FComSelect no tiene un componente llamado ComPort"[/b]
  5.   begin
  6.     FComSelect.ComPort := Value;
  7.     if FComSelect.ComPort <> nil then
  8.     begin
  9.       FComSelect.ComPort.FreeNotification(Self);
  10.       // transfer settings from ComPort to this control
  11.       UpdateSettings;
  12.     end;
  13.   end;
  14. end;



He revisado el codigo del ComComboBox y encuentro:



delphi
  1. // combo control for selecting port properties
  2.   TComComboBox = class(TCustomComboBox)
  3.   private
  4.   [b] FComSelect: TComSelect;[/b][b] // "FComSelect es de la clase TComSelect"[/b]
  5.     function GetAutoApply: Boolean;
  6.     function GetComPort: TCustomComPort;
  7.     function GetComProperty: TComProperty;
  8.     function GetText: string;
  9.     procedure SetAutoApply(const Value: Boolean);
  10.     procedure SetComPort(const Value: TCustomComPort);
  11.     procedure SetComProperty(const Value: TComProperty);
  12.     procedure SetText(const Value: string);
  13.   protected
  14.     procedure Notification(AComponent: TComponent; Operation: TOperation); override;
  15.     procedure Change; override;
  16.   public
  17.     constructor Create(AOwner: TComponent); override;
  18.     destructor Destroy; override;
  19.     procedure ApplySettings;
  20.     procedure UpdateSettings;
  21.   published
  22.     property ComPort: TCustomComPort read GetComPort write SetComPort;
  23.     property ComProperty: TComProperty read GetComProperty write SetComProperty default cpNone;
  24.     property AutoApply: Boolean read GetAutoApply write SetAutoApply default False;
  25.     property Text: string read GetText write SetText;
  26.     property Style;
  27.     property Color;
  28.     //property Ctl3D;
  29.     property DragCursor;
  30.     property DragMode;
  31.     property DropDownCount;
  32.     property Enabled;
  33.     property Font;
  34.     //property ImeMode;
  35.     //property ImeName;
  36.     property ItemHeight;
  37.     property ItemIndex;
  38.     property ParentColor;
  39.     //property ParentCtl3D;
  40.     property ParentFont;
  41.     property ParentShowHint;
  42.     property PopupMenu;
  43.     property ShowHint;
  44.     property TabOrder;
  45.     property TabStop;
  46.     property Visible;
  47.     property Anchors;
  48.     //property BiDiMode;
  49.     property CharCase;
  50.     property Constraints;
  51.     property DragKind;
  52.     //property ParentBiDiMode;
  53.     property OnChange;
  54.     property OnClick;
  55.     property OnDblClick;
  56.     property OnDragDrop;
  57.     property OnDragOver;
  58.     property OnDrawItem;
  59.     property OnDropDown;
  60.     property OnEndDrag;
  61.     property OnEnter;
  62.     property OnExit;
  63.     property OnKeyDown;
  64.     property OnKeyPress;
  65.     property OnKeyUp;
  66.     property OnMeasureItem;
  67.     property OnStartDrag;
  68.     property OnEndDock;
  69.     property OnStartDock;
  70.     property OnContextPopup;
  71.   end;



Y el TComSelect:



delphi
  1. // assistant class for TComComboBox, TComRadioGroup controls
  2.   TComSelect = class
  3.   private
  4.     FPort: TPort;
  5.     FBaudRate: TBaudRate;
  6.     FDataBits: TDataBits;
  7.     FStopBits: TStopBits;
  8.     FParity: TParityBits;
  9.     FFlowControl: TFlowControl;
  10.     FItems: TStrings;
  11.     FComProperty: TComProperty;
  12.     FComPort: TCustomComPort;  [b]//"Aqui se declara FComPort para la clase TComSelect"[/b]
  13.     FAutoApply: Boolean;
  14.   private
  15.     procedure SetComProperty(const Value: TComProperty);
  16.   public
  17.     procedure SelectPort;
  18.     procedure SelectBaudRate;
  19.     procedure SelectParity;
  20.     procedure SelectStopBits;
  21.     procedure SelectDataBits;
  22.     procedure SelectFlowControl;
  23.     procedure Change(const Text: string);
  24.     procedure UpdateSettings(var ItemIndex: Integer);
  25.     procedure ApplySettings;
  26.     property Items: TStrings read FItems write FItems;
  27.     property ComProperty: TComProperty read FComProperty write SetComProperty;
  28.     property ComPort: TCustomComPort read FComPort write FComPort; [b]//"Aqui escribimos en FComPort"[/b]
  29.     property AutoApply: Boolean read FAutoApply write FAutoApply;
  30.   end;



¿Que es lo que esta mal? llevo 3 días revisando esto y no encuentro el porque del error. El error se genera dentro y fuera del IDE.

Les agradezco el tiempo que puedan prestarme para esto. :)  (b) (b) (b) (b) (b) (b) (b) (b) (b)
  • 0

#2 poliburro

poliburro

    Advanced Member

  • Administrador
  • 4.945 mensajes
  • LocationMéxico

Escrito 29 marzo 2014 - 02:57

mmmm seguí el código y tampoco le ví nada raro. Trataré de instalarme CoeThypon para probar.
  • 0

#3 gerardoagraz

gerardoagraz

    Newbie

  • Miembros
  • Pip
  • 2 mensajes

Escrito 31 marzo 2014 - 06:27

Podrias poner exactamente el mensaje de error que te manda.
  • 0

#4 FGarcia

FGarcia

    Advanced Member

  • Miembro Platino
  • PipPipPip
  • 687 mensajes
  • LocationMéxico

Escrito 31 marzo 2014 - 10:00


Este es el mensaje de error:

[Window Title]
Error

[Content]
El proyecto CapturaPeso ha lanzado una excepción de la clase 'External: SIGSEGV'.

En archivo 'CPortCtl.pas' en linea 801:
if FComSelect.ComPort <> Value then

[Aceptar]

Adjunto dos imagenes sobre la linea 801 y la linea 801:



delphi
  1. // set ComPort property
  2. procedure TComComboBox.SetComPort(const Value: TCustomComPort);  //TCustomComPort
  3. begin
  4.   if FComSelect.ComPort <> Value then  // esta es la linea 801
  5.   begin
  6.     FComSelect.ComPort := Value;
  7.     if FComSelect.ComPort <> nil then
  8.     begin
  9.       FComSelect.ComPort.FreeNotification(Self);
  10.       // transfer settings from ComPort to this control
  11.       UpdateSettings;
  12.     end;
  13.   end;
  14. end;   

Archivos adjuntos


  • 0

#5 Edson

Edson

    Member

  • Miembros
  • PipPip
  • 26 mensajes

Escrito 02 abril 2014 - 02:43

Si la línea "if FComSelect.ComPort <> Value then", es la primera de un método, podría ser que ese método no existe (no se ha compilado), porque el objeto  no se ha creado.

Es decir si tu método es:

procedure TComComboBox.SetComPort(const Value: TCustomComPort);  //TCustomComPort
begin
  if FComSelect.ComPort <> Value then  // esta es la linea 801
  begin
...
end; 

Y el error hace referencia a la línea:

if FComSelect.ComPort <> Value then  // esta es la linea 801

Entonces, puede que el objeto de tipo "TComComboBox", no se haya creado al momento de intentar llamar al método SetComPort().

Puede que hayas modificado la definición de algún "ComComboBox1" en el formuario (tal vez lo hayas sacado de  Published).

Al menos es lo que se me ocurre.


  • 0




IP.Board spam blocked by CleanTalk.