Ver Mensaje Individual
  #2  
Antiguo 16-06-2013
beginner01 beginner01 is offline
Miembro
NULL
 
Registrado: mar 2011
Ubicación: República Dominicana
Posts: 181
Reputación: 14
beginner01 Va por buen camino
Hola.

Es bueno especificar que versión de delphi usas.

Yo realicé una prueba con tu código en Delphi xe y lo primero es que no vi el error que comentas, pero lo primero que te puedo sugerir es que agregues la función a ejecutar desde fuera de la dll en una sección exports.


Código Delphi [-]
library sms;

{ Important note about DLL memory management: ShareMem must be the
  first unit in your library's USES clause AND your project's (select
  Project-View Source) USES clause if your DLL exports any procedures or
  functions that pass strings as parameters or function results. This
  applies to all strings passed to and from your DLL--even those that
  are nested in records and classes. ShareMem is the interface unit to
  the BORLNDMM.DLL shared memory manager, which must be deployed along
  with your DLL. To avoid using BORLNDMM.DLL, pass string information
  using PChar or ShortString parameters. }

uses
  SysUtils,
  Classes,
  IdHTTP;

{$R *.res}
function enviarSMS (url,usuario,clave,phone,mensaje : string) : string;
var
  http: TIdHttp;
  params: TStrings;
  respuesta: string;
begin
    http := TIdHTTP.Create(nil);
    params := TStringList.Create;

    begin
        params.Add('usuario='+usuario);
        params.Add('clave='+clave);
        params.Add('telefonos='+phone);
        params.Add('texto='+mensaje);
        respuesta := http.Post(url, params);
    end;
    params.Free;
    http.Free;
end;

exports 
 enviarSMS;


end.
Responder Con Cita