No sound

No sound

Postby mosh1 » Mon Nov 19, 2012 9:38 pm

This same code working on one machine and is not working on the other - produces no sound.
What can be wrong ?

Code: Select all  Expand view
FUNCTION sndPlaySound( cFile, nFlags )
STATIC cTemplate
local lResult
IF cTemplate == NIL
  cTemplate := DllPrepareCall( "winmm.dll",;
               IIF( .F.,, 0x0020 ),;
               IIF( .T., "sndPlaySoundA", "sndPlaySound" ) )
ENDIF
lResult := DllExecuteCall( cTemplate, cFile, nFlags )
RETURN lResult

 
mosh1
 
Posts: 129
Joined: Sun Oct 09, 2011 3:50 pm

Re: No sound

Postby mosh1 » Wed Nov 21, 2012 9:34 pm

Please help - I am losing this customer
mosh1
 
Posts: 129
Joined: Sun Oct 09, 2011 3:50 pm

Re: No sound

Postby Otto » Wed Nov 21, 2012 9:46 pm

Hello,

I tried the fivewin sample testbmp2.prg which includes winmm.dll.
This is working fine here.
Is this working on your side?
Best regards,
Otto

Code: Select all  Expand view
// This sample shows how to display fancy floating bitmaps. Very nice!

#include "FiveWin.ch"

#define SRCPAINT   15597702   // 0xEE0086
#define SRCAND      8913094

static oWnd

//----------------------------------------------------------------------------//

function Main()

   DEFINE WINDOW oWnd TITLE "Testing bitmaps"

   @ 2, 2 BUTTON "&Fancy Message" SIZE 120, 25 ACTION MsgFancy()

   ACTIVATE WINDOW oWnd

return nil

//----------------------------------------------------------------------------//

function ShowBmp( oDlg )

   local hDC  := oDlg:hDC
   local oBmp1, oBmp2

   DEFINE BITMAP oBmp1 FILENAME "..\bitmaps\Cartoon.bmp"
   DEFINE BITMAP oBmp2 FILENAME "..\bitmaps\Cartoon2.bmp"

   DrawBitmap( hDC, oBmp2:hBitmap, 0, 0, 0, 0, SRCPAINT )
   DrawBitmap( hDC, oBmp1:hBitmap, 0, 0, 0, 0, SRCAND )

   oBmp1:End()
   oBmp2:End()

return nil

//----------------------------------------------------------------------------//

function MsgFancy()

   local oDlg, oBrush

   DEFINE BRUSH oBrush STYLE NULL             // Transparent painting !

   DEFINE DIALOG oDlg ;
      FROM 2, 2 TO 20, 30 TITLE "Invisible" ;
      BRUSH oBrush ;
      STYLE WS_POPUP

   ACTIVATE DIALOG oDlg CENTERED ;
      ON PAINT ShowBmp( oDlg ) ;
      ON LEFT CLICK oDlg:End() ;
      ON INIT  SndPlaySound( "..\sounds\verygood.wav" )

return nil

#ifdef __XPP__

DLL FUNCTION SndPlaySound( cFile AS LPSTR, nType AS LONG ) AS BOOL PASCAL ;
   FROM "sndPlaySoundA" LIB "winmm.dll"
   
#endif  

//----------------------------------------------------------------------------//

procedure AppSys   //  XBase++ requirement

return

//----
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: No sound

Postby mosh1 » Wed Nov 21, 2012 10:22 pm

Otto wrote:Hello,

I tried the fivewin sample testbmp2.prg which includes winmm.dll.
This is working fine here.
Is this working on your side?
Best regards,
Otto


Hello! I am not using FW in this application, it just HB3. And yes - its working on my desktop and on my laptop. Not working on customer's machine, however.

Code: Select all  Expand view
#define DLL_OSAPI 0x20

lRes := DllCall( "winmm.dll", DLL_OSAPI,;
 "sndPlaySoundA", "fndsnd.wav" ,SND_SYNC )
 
mosh1
 
Posts: 129
Joined: Sun Oct 09, 2011 3:50 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 80 guests

cron