Ver Mensaje Individual
  #12  
Antiguo 23-06-2008
[FGarcia] FGarcia is offline
Miembro Premium
 
Registrado: sep 2005
Ubicación: Cordoba, Veracruz, México
Posts: 1.123
Reputación: 20
FGarcia Va por buen camino
continuo en lo mismo...
Si vi el error de que lo genera el componente... supongo entonces que el problema estriba en la creacion del componente. Algo falta.

revise el codigo del componente y encontre que :

Código Delphi [-]
TComPort = class(TCustomComPort)

y que :

Código Delphi [-]
// create component
constructor TCustomComPort.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  // component cannot reside on inheritable forms
  FComponentStyle := FComponentStyle - [csInheritable];
  FLinks := TList.Create;
  FTriggersOnRxChar := True;
  FEventThreadPriority := tpNormal;
  FBaudRate := br9600;
  FCustomBaudRate := 9600;
  FPort := 'COM1';
  FStopBits := sbOneStopBit;
  FDataBits := dbEight;
  FEvents := [evRxChar, evTxEmpty, evRxFlag, evRing, evBreak,
             evCTS, evDSR, evError, evRLSD, evRx80Full];
  FHandle := INVALID_HANDLE_VALUE;
  FStoredProps := [spBasic];
  FParity := TComParity.Create;
  FParity.SetComPort(Self);
  FFlowControl := TComFlowControl.Create;
  FFlowControl.SetComPort(Self);
  FTimeouts := TComTimeouts.Create;
  FTimeouts.SetComPort(Self);
  FBuffer := TComBuffer.Create;
  FBuffer.SetComPort(Self);
end;

siguiendo, yo creo en la dll :

Código Delphi [-]
PuertoS := TComPort.Create(Application);
    PuertoS.Port := 'Com1';
    PuertoS.BaudRate := br9600;
    PuertoS.Parity.Bits  := prNone;
    PuertoS.StopBits := sbOneStopBit;
    PuertoS.DataBits := dbEight;
    PuertoS.Events := [evRxChar, evTxEmpty, evRxFlag, evRing, evBreak, evCTS, evDSR, evError, evRLSD, evRx80Full];
    PuertoS.StoredProps := [spBasic];
    PuertoS.FlowControl.OutCTSFlow := False;
    PuertoS.FlowControl.OutDSRFlow := False;
    PuertoS.FlowControl.ControlDTR := dtrDisable;
    PuertoS.FlowControl.ControlRTS := rtsDisable;
    PuertoS.FlowControl.XonXoffOut := False;
    PuertoS.FlowControl.XonXoffIn := False;

La pregunta para los que tengan la paciencia de revisar tantas lineas ¿es correcto como estoy creando el componente?

Reitero mi agradecimiento a la ayuda que puedan prestar.


P.d. Gracias Io por la explicacion de Pchar y Sting.
Responder Con Cita