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);
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);
edtNroFact.Text := INTTOSTR(s.CbteNro+1);
CreaNumeroFactura;
if (Length(s.Errors) > 0) then
showmessage(s.Errors[0].Msg);
finally
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
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.-