Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 03-06-2010
beemot beemot is offline
Registrado
 
Registrado: may 2010
Posts: 6
Poder: 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
  #2  
Antiguo 03-06-2010
JosepGA JosepGA is offline
Miembro
 
Registrado: jun 2007
Ubicación: Tarragona
Posts: 166
Poder: 17
JosepGA Va por buen camino
hola,

aquí tienes un hilo sobre dlls http://www.clubdelphi.com/foros/showthread.php?t=45136
Responder Con Cita
  #3  
Antiguo 05-06-2010
beemot beemot is offline
Registrado
 
Registrado: may 2010
Posts: 6
Poder: 0
beemot Va por buen camino
Des pues de ver mucho, era tanto el codigo que estava usando y el de la dll, tuve que ajustar la dll y despues mi codigo. saludos
Responder Con Cita
Respuesta



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
No se ha llamado a Coinitialize ???? Juan Marcos Providers 11 05-12-2016 22:23:28
No se ha llamado a CoInitialize newlink OOP 4 10-12-2009 15:08:23
Llamado a una función de una dll Ricardo León Varios 8 16-12-2005 16:53:08
No se ha llamado a CoInitialize. ElCherchu Conexión con bases de datos 1 21-02-2005 15:54:39
Llamado de formas malcantar Varios 6 15-07-2003 19:27:14


La franja horaria es GMT +2. Ahora son las 18:51:27.


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