Imortis wrote: ↑Apr 03, 2023 1:15
Most people do not use lang "qb" with new code for this exact reason. Anything outside of making old qb code compile with minimal changesbis a bit outside the scope of what the qb dialect was designed for. I have not had time to investigate this myself so I can't answer your question just now. I will see what I can do if the qb dialect is absolutely required, but I am not sure it is possible.
Any efforts towards bringing new FB code to lang qb is valuable to me and others as well.
I compiled this.
Code: Select all
#cmdline "-pp"
#define winincludeall
#include "windows.bi"
#include "win/mmsystem.bi"
looked though the results and found these definitions
Code: Select all
declare function sndPlaySoundA(byval pszSound as LPCSTR, byval fuSound as UINT) as WINBOOL
declare function sndPlaySoundW(byval pszSound as LPCWSTR, byval fuSound as UINT) as WINBOOL
declare function sndPlaySound alias "sndPlaySoundA"(byval pszSound as LPCSTR, byval fuSound as UINT) as WINBOOL
const SND_SYNC = &h00000
const SND_ASYNC = &h0001
const SND_NODEFAULT = &h0002
const SND_MEMORY = &h0004
const SND_LOOP = &h0008
const SND_NOSTOP = &h0010
const SND_NOWAIT = &h00002000
const SND_ALIAS = &h00010000
const SND_ALIAS_ID = &h00110000
const SND_FILENAME = &h00020000
const SND_RESOURCE = &h00040004
const SND_PURGE = &h0040
const SND_APPLICATION = &h0080
const SND_ALIAS_START = 0
declare function PlaySoundA(byval pszSound as LPCSTR, byval hmod as HMODULE, byval fdwSound as DWORD) as WINBOOL
declare function PlaySoundW(byval pszSound as LPCWSTR, byval hmod as HMODULE, byval fdwSound as DWORD) as WINBOOL
declare function PlaySound alias "PlaySoundA"(byval pszSound as LPCSTR, byval hmod as HMODULE, byval fdwSound as DWORD) as WINBOOL
I tried defining with something like this, but no luck no matter how I try writing it.
Code: Select all
DECLARE FUNCTION PLAYWAV ALIAS "sndPlaySound"(BYVAL pszSound AS LPCSTR, BYVAL fuSound AS __UINT) AS WINBOOL
I was able to get the beep command working for now. This is a good start. I will be pulling my hair out trying to figure out how to play wav files with windows API now.
Code: Select all
DECLARE FUNCTION SOUND ALIAS "BEEP"(BYVAL f AS INTEGER,BYVAL d AS INTEGER) AS INTEGER