Drive me INSANE (Dx8 sound)
Alright, I've got this code... I don't understand how the error can happen:
I have a general "loadsound" sub, so I don't have to look at DX code, lalala... anyways:
VB Code:
Public Sub LoadSound(ByVal Path As String, ByRef Buffer As DirectSoundSecondaryBuffer8)
Dim DsDesc As DSBUFFERDESC
DsDesc.lFlags = DSBCAPS_CTRLFREQUENCY Or DSBCAPS_CTRLPAN Or DSBCAPS_CTRLVOLUME
Set Buffer = DSound.CreateSoundBufferFromFile(App.Path & Path, DsDesc)
'ERROR: byref argument type mismatch
'DsDesc is highlighted. what could cause this?
End Sub
Re: Drive me INSANE (Dx8 sound)
Quote:
Originally posted by alkatran
Alright, I've got this code... I don't understand how the error can happen:
I have a general "loadsound" sub, so I don't have to look at DX code, lalala... anyways:
VB Code:
Public Sub LoadSound(ByVal Path As String, ByRef Buffer As DirectSoundSecondaryBuffer8)
Dim DsDesc As DSBUFFERDESC
DsDesc.lFlags = DSBCAPS_CTRLFREQUENCY Or DSBCAPS_CTRLPAN Or DSBCAPS_CTRLVOLUME
Set Buffer = DSound.CreateSoundBufferFromFile(App.Path & Path, DsDesc)
'ERROR: byref argument type mismatch
'DsDesc is highlighted. what could cause this?
End Sub
What type does the CreateSoundBufferFromFile() function take as the last parameter? The error is saying its not DSBUFFERDESC. If it is then put DxVBLibA.DSBUFFERDESC as the type.