In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Utilizar DLL

Foro de Xailer profesional en español
Responder
vily
Mensajes: 7
Registrado: Sab Jul 16, 2005 11:17 am

Utilizar DLL

Mensaje por vily »

Hola.
Estoy intentando cargar una DLL y siguiendo unas instrucciones que encontré
aquí, he intentado hacer el siguiente ejemplo:
FUNCTION sndPlaySoundA( pszSound,fuSound )
STATIC hLib
STATIC nProcAddr
IF nProcAddr == NIL
hLib := Loadlibrary( "WINMM" )
nProcAddr := GetProcAddress( hLib, "sndPlaySoundA" )
ENDIF
Return CallDLL( hLib, nProcAddr,, 8, 10, pszSound, -3, fuSound )
Pero al compilar me da los siguientes errores:
-Error: Unresolved external '_HB_FUN_GETPROCADDRESS' referenced from
C:XAILERSAMPLESDLLOBJFORMCALLDLL.OBJ
-Error: Unresolved external '_HB_FUN_CALLDLL' referenced from
C:XAILERSAMPLESDLLOBJFORMCALLDLL.OBJ
Alguien puede decirme que es lo que me falta o que estoy haciendo mal.
Muchas gracias.
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Utilizar DLL

Mensaje por jfgimenez »

José,
> Estoy intentando cargar una DLL y siguiendo unas instrucciones que
> encontré aquí, he intentado hacer el siguiente ejemplo:
>
>
>
> FUNCTION sndPlaySoundA( pszSound,fuSound )
Necesitas hacer un "wrapper" en C. Sería algo así:
//---------------------------------------------------------- --------------------
#pragma BEGINDUMP
#include "windows.h"
#include "xailer.h"
XA_FUNC( PLAYSOUND )
{
hb_retl( PlaySound( hb_parc( 1 ), (HINSTANCE) hb_parnl( 2 ), hb_parnl(
3 ) ) );
}
#pragma ENDDUMP
//---------------------------------------------------------- --------------------
Y para llamar a la función lo harías así:
PlaySound( "c:winxpmediatada.wav",, nOr( SND_ASYNC, SND_FILENAME ) )
--
Un saludo,
José F. Giménez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Responder