Utilizamos cookies propias y de terceros. [Más información sobre las cookies].
Política de cookies
Proyecto AjpdSoft

· Inicio
· Buscar
· Contactar
· Cookies
· Descargas
· Foros
· Historia
· Nosotros
· Temas
· Top 10
· Trucos
· Tutoriales
· Wiki
Proyecto AjpdSoft: Foros

AjpdSoft :: Ver tema - Error al Llamar Función en DLL (Interface not suported).
Foros de discusión Buscar Perfil FAQ Iniciar sesión
Information Error al Llamar Función en DLL (Interface not suported).

Publicar nuevo tema Responder al tema
Foros de discusión » Borland Delphi, Codegear Delphi .Net   
Ver tema anterior :: Ver tema siguiente
AutorMensaje
sammary
Buen usuario


Registrado: Jun 27, 2004
Mensajes: 10

Asunto: Error al Llamar Función en DLL (Interface not suported). Responder citando

Buenas, estoy escribiendo una función para enviar datos post a un gateway de sms, ya hice la función y todo perfecto, pero ahora me gustaría tenerla en dll la paso a dll pero me dice Interface Not Suported, aqui dejo el codigo de la dll y la llamada.

Codigo DLL.
Código:
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; export
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;
end.


este es el de la llamada

Código:
var
Form1: TForm1;
function enviarSMS (url,usuario,clave,phone,mensaje : string) : string; stdcall external'sms.dll';
implementation

{$R *.dfm}

procedure TForm1.btn1Click(Sender: TObject);
begin
enviarSMS(edt1.Text,edt2.Text,edt3.Text,edt4.Text,edt5.Text);
edt4.Clear;
edt5.Clear;
end;
MensajePublicado:
Dom Jun 16, 2013 3:37 pm
Top of PageVer perfil de usuario
Mostrar mensajes de anteriores:   
Todas las horas son GMT - 1 Horas
Publicar nuevo tema Responder al tema
Foros de discusión » Borland Delphi, Codegear Delphi .Net  

Cambiar a:  
Key
  Puede publicar nuevos temas en este foro
No puede responder a temas en este foro
No puede editar sus mensajes en este foro
No puede borrar sus mensajes en este foro
No puede votar en encuestas en este foro
Visita nuestro nuevo sitio web con programas y contenidos actualizados: Proyecto A