Ver Mensaje Individual
  #1  
Antiguo 03-06-2010
beemot beemot is offline
Registrado
 
Registrado: may 2010
Posts: 6
Reputación: 0
beemot Va por buen camino
Unhappy !! Ayuda con error de llamado ddl !!

Hola amigos, tengo un programa, el cual manda a llamar una ddl y la mando allamar bien, pero al segir mi procedimiento me da un error y no trabaja bien

Código:
  function SendDocumentReturnPDF(inXML: string;
                        var hint: string;
                        var data: string;
                        var batch: string;
                        var serial: string;
                        var outXML: string;
                        var outPDF64: string):integer; stdcall; external 'libreria.dll'
 
---
procedure tprinsipal.TlecturaTimer(Sender: TObject);
var InicioCont:integer;
outXML, hint, data, batch, serial, outPDF64: string;
begin
  outPDF64:='';
        //leer y escribir
  BProgreso.Position:=BProgreso.Position+1;
  if (BProgreso.Position>=BProgreso.Max) then
  begin
    BProgreso.Position:=0;
  end;
  update;
  if BProgreso.Position=49 then
  begin
    LeerCarpeta;
    InicioArchivos:=Procesar.Count;
    if InicioArchivos>0 then
    begin
        tlectura.Interval:=600;
      for InicioCont:=0 to procesar.Count-1 do
      begin
          Procesar.ItemIndex:=InicioCont;
          GenerarXML;
          Enviar;  //aqui mando a llamar el procedimiento que llama la ddl
      end;
      EliminarTxt;
      tlectura.Interval:=50;
    end;
  end;
end;
 
procedure prinsipal.Enviar;
var inXML:string;
var hint: string;
var data: string;
var batch: string;
var serial: string;
var outXML: string;
var outPDF64: string;
Result:integer;
begin
        inXML:=CapturarXML;
        try
                Result := SendDocumentReturnPDF(inXML, hint, data, batch, serial, outXML, outPDF64);
        except
                on e:Exception do
                begin
                        Result:= -33;
                        hint:=e.Message;
                        data:='';
                        batch:='';
                        serial:='';
                        outxml:='';
                end;
        end;
        if Result <> 0 then
                begin
                memo1.Text:=('Res: ' + IntToStr(result) + #13#10 + 'Hint: ' + hint + #13#10 + 'Data: ' + data);
                ErrorCapturado:=memo1.Text;
                if GuardarError=1 then
                        GenerarError;
        end;
        if Result = 0 then
                if ImprimirPDF=1 then
                        ImprimirFactura(outPDF64);
end;
lo que hace es que manda a llamar un procedimiento que guarda un pdf de outpdf64 y si me lo genera y lo guardo, pero al terminar este procedimiento me da un error de

exception class einvalidpointer whit mensage "invalid pointer operation"

y me da en la torre en todo el programa ya que se cicla y no hace los procedmimientos siguientes.

no se si sea error de la dll o de mi programacion, pero segun estoy manejando la dll como deve de ser...

en si el programa lee un txt con formato xml, lo manda a la dll la cual me regresa un pdf que guardo e imprimo y eso si lo hace, pero al terminar y regresar al flujo normal de donde llame al procedimiento, me da ese error.

espero me puedan ayudar. gracias
Responder Con Cita