Ver Mensaje Individual
  #1  
Antiguo 29-09-2015
adripugliesso adripugliesso is offline
Miembro
NULL
 
Registrado: jul 2015
Posts: 49
Reputación: 0
adripugliesso Va por buen camino
Error Raro, No encuentro Causa

Tengo una aplicacion que tiene el sig. procedure:

Código Delphi [-]
procedure TfmFacturar.btnBuscaNroClick(Sender: TObject);
var
  s: FERecuperaLastCbteResponse;
  FEAuth : FEAuthRequest;
  x : Integer;
  WS: ServiceSoap;
  i : integer;
begin

  screen.Cursor := crHourGlass;

  
    WS := GetServiceSoap(false,'', httprio2);

    //WS := GetServiceSoap;


  FEAuth  := FEAuthRequest.Create;
  s:= FERecuperaLastCbteResponse.Create;
  try
    FEAuth.Token := token;
    FEAuth.Sign  := sign;
    FEAuth.Cuit  := cuit;

    s := WS.FECompUltimoAutorizado(FEAuth, strtoint(edtPuntoVta.Text), dbTipoCbte.KeyValue);


    //carga numero de factura
    edtNroFact.Text := INTTOSTR(s.CbteNro+1);
    CreaNumeroFactura;

      if (Length(s.Errors) > 0) then
      showmessage(s.Errors[0].Msg);

  finally

    //habilita Agregar Items
    GItems.Enabled          := true;
    btnAgregaItem.Enabled   := true;
    edtSubtotal.Enabled     := true;
    edtIva105.Enabled       := true;
    edtIva21.Enabled        := true;
    edtPercIIBB.Enabled     := true;
    edtPercIVA.Enabled      := true;
    edtTotal.Enabled        := true;
    btnSolicitaCae.Enabled  := true;


    i:= dbTipoCbte.KeyValue;
    if (i IN [2,3,7,8]) then
    begin
      btnLiquidoProd.Enabled  := false;
      btnImpRemito.Enabled    := false;
      edtRemitos.Enabled      := false;
      edtRemitos.Text         := '9999';
    end
    else
    begin
      btnLiquidoProd.Enabled  := true;
      btnImpRemito.Enabled    := true;
      edtRemitos.Enabled      := true;
    end;



    ActualizaListaItems;

    LCod.Caption := '0'+INTTOSTR(dbTipoCbte.KeyValue);

    FEAuth.Free;
    s.Free;
  end;

  screen.Cursor := crDefault;


end;

El problema que tengo es que cuando compilo y genero el ejecutable al usar este procedure tira error de "Access Violation at address 00406780", entonces si yo entro al codigo y cambio la linea

Código Delphi [-]
WS := GetServiceSoap(false,'', httprio2);

por

Código Delphi [-]
WS := GetServiceSoap;

Complio y ejecuto funiona perfecto sin error. Luego al realizar un cambio en la aplicacion y volvar a compilar y ejecutar vuelve a tirar el error de Access Violation entonces tengo que volver a entrar al codigo y cambiar nuevamente la linea esa de codigo y ponerla como estaba, de esa manera no tira el error.

En Conclucion para que este proceso no tire error cada vez que compilo tengo que entrar y cambiar una linea por otra, alguien sabe a que se debe ese error??

Gracias.-
Responder Con Cita