Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sound Card Detect Problem
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Sound Card Detect Problem
Miscellaneous
Thread ID:
00348334
Message ID:
00348334
Views:
57
Hi. I was attempting to use the soundcard detection VFP code from the KB archive. I can't get it to work. I think it is because I don't have the same sound card Registry entries that the code looks for. Doing a Registry query (NT4/SP6a) I can see this in my hklm\system\currentcontrolset\mediaresources key:
	Listing of [system\currentcontrolset\control\mediaresources]
	
	[icm]
	[icm\vidc.ctrx]
	REG_SZ          Description     Citrix Scalable Video Product
	REG_SZ          FriendlyName    Citrix Scalable Video Product
	REG_SZ          driver  ctrxvid.drv
	[mci]
	[mci\cdaudio]
	REG_BINARY      Default Drive   Data to follow:
	
	00000000
	[mci\cdaudio\unit 0]
	REG_BINARY      Volume Settings Data to follow:
	
	00000000  FF000000
	[MIDI]
	[MIDI\aztaud.dll<0000>]
	REG_SZ          Active  1
	REG_SZ          Description     FM Synth
	REG_SZ          DeviceID
	REG_BINARY      DevNode Data to follow:
	
	
	REG_SZ          Driver  aztaud.dll
	REG_SZ          FriendlyName    FM Synth
	REG_SZ          External        0
	REG_DWORD       PhysDevID       1
	REG_DWORD       Port    0
	REG_DWORD       MapperConfig    1
	REG_SZ          SOFTWAREKEY
	REG_SZ          Migrated        1
	[MIDI\aztaud.dll<0000>\Instruments]
	[MIDI\mmdrv.dll<0000>]
	REG_SZ          Active  1
	REG_SZ          Description     Midi Out
	REG_SZ          DeviceID
	REG_BINARY      DevNode Data to follow:
	
	
	REG_SZ          Driver  mmdrv.dll
	REG_SZ          FriendlyName    Midi Out
	REG_SZ          External        1
	REG_DWORD       PhysDevID       0
	REG_DWORD       Port    0
	REG_DWORD       MapperConfig    1
	REG_SZ          SOFTWAREKEY
	REG_SZ          Migrated        1
	[MIDI\mmdrv.dll<0000>\Instruments]
	[NonGeneralMIDIDriverList]
The code:

#DEFINE HKEY_LOCAL_MACHINE -2147483646 
local llSCFound
local lcSomeData
local KEY_WAVE_MSINFO
llSCFound = .F.
lcSomeData = ""
KEY_WAVE_MSINFO = "system\currentcontrolset\control\mediaresources\Wave\"
SET CLASSLIB TO REGISTRY.VCX
oReg = CREATEOBJECT('Registry')
RELEASE CLASSLIB REGISTRY.VCX
DIMENSION a_keys[1]
lnerror = oReg.OpenKey(KEY_WAVE_MSINFO, HKEY_LOCAL_MACHINE)
IF lnerror = 0
	lnerror = oReg.EnumKeys(@a_keys)
	IF lnerror = 0
		FOR lni = 1 TO ALEN(a_keys, 1)
			key_wave_msinfo = "system\currentcontrolset\control\mediaresources\Wave\"+a_keys[lni]
			oReg.GetRegKey("driver",@lcsomedata,KEY_WAVE_MSINFO,HKEY_LOCAL_MACHINE)
			if ! empty(lcSomeData)
				llSCFound = .T.
				exit
			endif
		NEXT
	ENDIF
	oReg.CloseKey
ENDIF
RETURN llSCFound
Next
Reply
Map
View

Click here to load this message in the networking platform