FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC I want the use wave files
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
I want the use wave files
Posted: Tue Jul 29, 2008 10:04 PM

Salvador,

Prueba a cambiar esta línea:

pW3 = AnsiToWide( ( LPSTR ) LockResource( hglb ) );

por:

pW3 = AnsiToWide( ( LPSTR ) hglb );

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 144
Joined: Sun Dec 18, 2005 03:18 PM
I want the use wave files
Posted: Wed Jul 30, 2008 09:39 AM
Antonio,
De esta manera funciona:
LPWSTR AnsiToWide( LPSTR );

HB_FUNC( PLAYSOUNDRESOURCE ) 
{ 
   LPWSTR pW = AnsiToWide( hb_parc( 1 ) ) ; 
        
   hb_retl( PlaySound( pW,  GetModuleHandle(NULL), ( ( hb_pcount() > 1 ) ? hb_parni( 2 ) : SND_ASYNC ) | SND_RESOURCE |    SND_NODEFAULT ) ); 
                      
}


Gracias.
Saludos

Salvador
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
I want the use wave files
Posted: Wed Jul 30, 2008 10:09 AM

Salvador,

Hace falta una última llamada a hb_xfree( pW ); para liberar la memoria creada.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 144
Joined: Sun Dec 18, 2005 03:18 PM
I want the use wave files
Posted: Wed Jul 30, 2008 10:41 AM

Ok, gracias

Saludos

Salvador

Continue the discussion