Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Delphi para la web
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 06-01-2021
Punzo Punzo is offline
Miembro
 
Registrado: abr 2006
Posts: 96
Poder: 19
Punzo Va por buen camino
Componente indy dentro de una dll

Buen día a todos, hay algunos factores a tomar en cuenta para hacer una dll con indy 10.6.2 y su componente TidTCPClient?, ya que quiero convertir un exe, que funciona sin problemas, y al pasarlo a dll, me genera Access Violations, en 2 partes que con el exe no lo hace; lo más raro de todo, es que lo hace bien la primera vez, dejo la parte del código(comento las parte donde me da el error), dónde tengo el problema, gracias de antemano.
Código Delphi [-]
procedure TfmConfiguracion.btCargaFamiliasClick(Sender: TObject);
var
  R, Codigo :String;
  JF :TJSONObject;
  Familia :TFamilia;
  NumB, i :Integer;
begin
if (edCaja.Text <> '') and (edTurno.Text <> '') then
  begin
    if NumFam = 0 then
      begin
        SetLength(AFam, NumFam + 1);
        AFam[NumFam] := '000000';
        Codigo := AFam[NumFam];
      end
      else if (Sender is TFamilia) then
        begin
          SetLength(AFam, NumFam + 1);
          AFam[NumFam] := (Sender as TFamilia).Codigo;
          Codigo := AFam[NumFam];
        end
        else
          begin
            Codigo := AFam[NumFam];
          end;
    //  Aquí me manda un Access Violation, la tercera vez que le doy click al boton que dice "cerveza", 
    //  pero no me da el error si le doy click al boton que dice "brandy"
    ClienConLocal.SendCmd('carga_familia ' + Codigo + ' ' + edCaja.Text + ' ' + edTurno.Text + ' ' + IDCliente);
    R := ClienConLocal.LastCmdResult.Text.Text;
    JF := TJSONObject.Parse(R) as TJSONObject;
    NumB := JF['botones'].Count;
    if (NumB > 0) or (JF.S['ayb_fam'] = 'F') then
      begin
        LimpiarPanel(pnFamilias);
        Inc(NumFam);
      end
      else
        begin
          if MessageDlg('¿Estás seguro de agregar ' + (Sender as Tfamilia).Descripcion + ' a Terminados?',
                        mtConfirmation, [mbYes, mbNo], 0, mbYes) = mrYes then
            begin
              LlenarGrid(Sender);
            end;
        end;

    for i := 1 to NumB do
      begin
        Familia := TFamilia.Create(pnFamilias);//Despúes de 3 veces de darle click, me manda el Acces Violation
        Familia.Descripcion := TBase64Encoding.Base64.Decode(JF['botones'].ArrayValue.O[i - 1].S['descrip']);
        Familia.Caption := TBase64Encoding.Base64.Decode(JF['botones'].ArrayValue.O[i - 1].S['descrip']);
        Familia.Codigo := JF['botones'].ArrayValue.O[i - 1].S['codigo'];
        Familia.Precio :=  JF['botones'].ArrayValue.O[i - 1].S['precio'];
        Familia.Impto1 := JF['botones'].ArrayValue.O[i - 1].S['impto1'];
        Familia.Impto2 := JF['botones'].ArrayValue.O[i - 1].S['impto2'];
        Familia.Imprime := JF['botones'].ArrayValue.O[i - 1].S['imprime'];
        Familia.Servicio := JF['botones'].ArrayValue.O[i - 1].S['servicio'];
        Familia.AyB_Fam := JF['botones'].ArrayValue.O[i - 1].S['tipo_ayb'];
        if JF['botones'].ArrayValue.O[i - 1].S['terminado'] = 'S' then
          Familia.Terminado := True
        else
          Familia.Terminado := False;
        Familia.Enabled := Familia.Terminado;
        if JF['botones'].ArrayValue.O[i - 1].S['indica'] <> '' then
          Familia.Indicaciones := JF['botones'].ArrayValue.O[i - 1].S['indica'];
        if JF['botones'].ArrayValue.O[i - 1].S['sugerencias'] <> '' then
          Familia.Sugerencias := JF['botones'].ArrayValue.O[i - 1].S['sugerencias'];
        Familia.Parent := pnFamilias;
        Familia.Font.Size := 10;
        Familia.WordWrap := True;
        Familia.Width := 90;
        Familia.Height := 90;
        Familia.Margins.Left := 5;
        Familia.Margins.Top := 5;
        Familia.Margins.Right := 5;
        Familia.Margins.Bottom := 5;
        Familia.OnClick := btCargaFamiliasClick;
      end;
  end
  else
    ShowMessage('Los campos Caja y Turno son obligatorios');
end;

Última edición por Casimiro Notevi fecha: 06-01-2021 a las 23:38:28.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Componente Indy tidsnmp Er0s Internet 2 07-06-2018 10:04:30
Componente Indy TCPClient cmfab Varios 1 16-06-2014 14:29:05
Error con componente Indy Alexander Varios 1 04-07-2006 06:15:07
Componente Indy comba Internet 2 22-06-2005 16:00:24
Componente Indy FTPServer bochi Internet 5 19-12-2003 16:39:10


La franja horaria es GMT +2. Ahora son las 11:08:49.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi