Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/05/2006, 09:39
Avatar de VisualGuallabo
VisualGuallabo
 
Fecha de Ingreso: marzo-2005
Mensajes: 288
Antigüedad: 20 años
Puntos: 2
Error al llamar una funcion en una dll

Realice una dll de prueva con Dev c++. y cuando llamo a la funcion me da error 49 en tiempo he ejecución:
La convencion de llamadas a DLL es incorrecta.

esta es la llamada a la dll

Private Declare Function mensaje Lib "Proyecto1.dll" (ByVal mensaje As String, ByVal titulo As String) As Long

Private Sub Form_Load()

mensaje "hOLA", Me.Caption

End Sub

--Codigo de c
***En dll.h***
#ifndef _DLL_H_
#define _DLL_H_

#if BUILDING_DLL
# define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
# define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */

****En dllmain.c********
#include "dll.h"
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>

DLLIMPORT void HelloWorld (char * mensaje,char * titulo)
{
MessageBox (0, mensaje, titulo, MB_ICONINFORMATION);
}


DLLIMPORT void msg()
{
MessageBox (0, "DEMO PLUGING FOR Yosvanis Cruz", "Yosvanis", MB_ICONINFORMATION);
}

BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
break;

case DLL_PROCESS_DETACH:
break;

case DLL_THREAD_ATTACH:
break;

case DLL_THREAD_DETACH:
break;
}

/* Returns TRUE on success, FALSE on failure */
return TRUE;
}

DLLIMPORT void HelloWorld (char * mensaje,char * titulo);

#endif /* _DLL_H_ */



--
Si alguien puede desirme cual es el problema se lo agradesco. una cosa cuando compilo el proyecto de vb ya no sale el error solo cuando lo pruevo en tiempo de diseño.
__________________
"No hay lenguaje de programación potente que sea inferior a otro semejante cuando existe un buen programador que lo defiende"

Yosvanis Cruz Alias VisualGuallabo
Ycruz