Cita:
Empezado por manuc
Hola Richy08,
Código Delphi [-]
[Error] Interfaces.pas(47): Unsatisfied forward or external declaration: 'tmisComponentes.Destroy'
No estoy seguro, pero ¿puede ser que te falte la implementación de este procedimiento?
|
a ok si me imaginaba algo asi, sabes estoy un poco enredado es la primera ves que me veo en la necesidad de usar clases que yo mismo creo, me imagino que en esta parte es donde le doy .free a los querys que creo para que liberen dicha memoria??
Cita:
Empezado por manuc
Después en estas líneas de código:
Código Delphi [-]
ActClient := PClient(AThread.Data);
ActClient.LastAction := Now; // update the time of last action
MisComponentes := tmisComponentes(AThread.Data);
En "AThread.Data" ¿que almacenas la estructura de tipo "PClient" y de tipo "tmisComponentes"?
|
asi es en AThread.Data almaceno los datos de esas dos estructuras.
Cita:
Empezado por manuc
Por otro lado, si puedieras hacer un seguimiento a la ejecución del código e indicarme la línea más o menos donde te da el error, te podría dar alguna sugerencia.
No obstante revisaré el código que has puesto a ver si veo algo raro.
Un saludo.
|
ya he corrido paso a paso el codigo y en la linea que me salta el error es
MisComponentes.Conexion.ConnectionString:=cadena;
Código Delphi
[-]
procedure TFrm_Interfaces.ServerExecute(AThread: TIdPeerThread);
var
ActClient, RecClient: PClient;
CommBlock, NewCommBlock: TCommBlock;
RecThread: TIdPeerThread;
i, seleccion: Integer;
MisComponentes:tmisComponentes;
begin
if not AThread.Terminated and AThread.Connection.Connected then
begin
AThread.Connection.ReadBuffer (CommBlock, SizeOf (CommBlock));
ActClient := PClient(AThread.Data);
ActClient.LastAction := Now; MisComponentes := tmisComponentes(AThread.Data);
MisComponentes.Conexion.ConnectionString:=cadena; MisComponentes.Conexion.loginprompt:=false;
MisComponentes.Conexion.provider:='SQLOLEDB.1';
MisComponentes.Conexion.connected;
MisComponentes.Conexion1.Catalog:= 'lookup';
MisComponentes.Conexion1.Database:= 'cdr';
MisComponentes.Conexion1.HostName:= '192.168.10.3';
MisComponentes.Conexion1.Password:= 'siti270';
MisComponentes.Conexion1.Protocol:= 'mysql-5';
MisComponentes.Conexion1.port:= 3306;
MisComponentes.Conexion1.User:= 'root';
MisComponentes.Conexion1.connect;
MisComponentes.Query.Close;
MisComponentes.Query.Connection:= MisComponentes.Conexion;
MisComponentes.Query.SQL.Text:='select idext, DesTel from pbx_ext where acode=:acode';
MisComponentes.Query.parameters.ParamByName('acode').Value:=CommBlock.acode;
MisComponentes.Query.cursorType := ctStatic;
MisComponentes.Query.open;
MisComponentes.Query1.Connection:=MisComponentes.Conexion1;
MisComponentes.Query1.SQL.Text:='update lookup set allowcalls=:allowcalls, ldesc=:ldesc where code=:code ';
i:=0;
seleccion:=Query.RecordCount;
MisComponentes.Query.First;
While ido
begin
MisComponentes.Query1.Close;
MisComponentes.Query1.ParamByName('allowcalls').Value:=CommBlock.estado;
MisComponentes.Query1.ParamByName('ldesc').Value:=CommBlock.nombre;
MisComponentes.Query1.ParamByName('code').Value:=MisComponentes.Query1.fieldbyname('idext').Value;
MisComponentes.Query1.ExecSQL;
i:=i+1;
MisComponentes.Query.Next;
end;
Protocol.Lines.Add (TimeToStr(Time)+' The process for '+CommBlock.MyUserName+' was done '); NewCommBlock.Command := 'DIALOG'; NewCommBlock.MyUserName := '[PBX Server]'; NewCommBlock.Msg := 'The process was done '; NewCommBlock.ReceiverName := '[return-to-sender]'; AThread.Connection.WriteBuffer (NewCommBlock, SizeOf (NewCommBlock), true); end;
end;
gracias por tus respuestas