DirectX 8 - VB .Net (CaptureAudio) 
Author Message
 DirectX 8 - VB .Net (CaptureAudio)

I'm spanish. Excuse me for my english.
Please, I ask for help. Thanks.

W-XP, VB .Net, DirectX 8.
Capture Waves.

runtime error when execute the next metod:
"DSCBuffer.SetNotificationPositions"

This code run ok in VB6, but runtime error in VB .NET.

Public Sub CrearPuntosControl(ByRef Sender As frmPanel)
    Dim psaPosicionBuffer() As DSBPOSITIONNOTIFY
    Dim icontador As Integer
    Dim NumeroEventos As Long

    NumeroEventos = 20

    ReDim psaPosicionBuffer(NumeroEventos)

    BufferBytes = DSCTipoBuffer.lBufferBytes

    'se introducen los puntos de notificacion en el array
    For icontador = 0 To NumeroEventos
        psaPosicionBuffer(icontador).hEventNotify = Dx.CreateEvent(Sender)
        psaPosicionBuffer(icontador).lOffset = (bufferBytes/NumeroEventos) *
icontador
    Next

    'se establecen los puntos de notificacion
    DSCBuffer.SetNotificationPositions(NumeroEventos, psaPosicionBuffer)
'------> In this line runtime error.

End Sub

In spanish, the text error is:
"Excepcin no controlada del tipo
'System.Runtime.InteropServices.COMException' en Audio2.exe
Informacin adicional: No se ha encontrado el elemento."



Sat, 13 Nov 2004 20:23:33 GMT  
 DirectX 8 - VB .Net (CaptureAudio)
There are a bunch of problems with DirectX 8.1 and VB.NET. Unfortunately,
Microsoft doesn't support this combination. While I've found workarounds
for some of the Direct3D problems, I haven't figured out how to make
DirectSound work properly. You should stick with VB6 until DirectX 9 is
released late this year. You could potentially create a COM component in
VB6 that handles you DirectSound calls and call that routine from VB.NET.

      .........Wayne

"Recycling electrons into words since 1996."
Visit www.JustPC.com for details about my Visual Basic books, including
my newest: Windows Game Programming With Visual Basic and DirectX,
and the ASP.NET Database Programming Bible. Subscribe to the JustPC
Developer's Journal - a free email newsletter for Visual Basic programmers


Quote:
> I'm spanish. Excuse me for my english.
> Please, I ask for help. Thanks.

> W-XP, VB .Net, DirectX 8.
> Capture Waves.

> runtime error when execute the next metod:
> "DSCBuffer.SetNotificationPositions"

> This code run ok in VB6, but runtime error in VB .NET.

> Public Sub CrearPuntosControl(ByRef Sender As frmPanel)
>     Dim psaPosicionBuffer() As DSBPOSITIONNOTIFY
>     Dim icontador As Integer
>     Dim NumeroEventos As Long

>     NumeroEventos = 20

>     ReDim psaPosicionBuffer(NumeroEventos)

>     BufferBytes = DSCTipoBuffer.lBufferBytes

>     'se introducen los puntos de notificacion en el array
>     For icontador = 0 To NumeroEventos
>         psaPosicionBuffer(icontador).hEventNotify =

Dx.CreateEvent(Sender)
Quote:
>         psaPosicionBuffer(icontador).lOffset =

(bufferBytes/NumeroEventos) *

- Show quoted text -

Quote:
> icontador
>     Next

>     'se establecen los puntos de notificacion
>     DSCBuffer.SetNotificationPositions(NumeroEventos, psaPosicionBuffer)
> '------> In this line runtime error.

> End Sub

> In spanish, the text error is:
> "Excepcin no controlada del tipo
> 'System.Runtime.InteropServices.COMException' en Audio2.exe
> Informacin adicional: No se ha encontrado el elemento."



Sat, 13 Nov 2004 20:13:16 GMT  
 DirectX 8 - VB .Net (CaptureAudio)
Try perhaps to pass the first cell instead of the array itself...

That said it's probably better to keep using DX8 from a COM based language
adn to start using .NET with DX9 due later this year...
As DirectX covers quite a whole range of cases regarding passing parameters
back and forth there are a number of issues...

Patrice



Quote:
> I'm spanish. Excuse me for my english.
> Please, I ask for help. Thanks.

> W-XP, VB .Net, DirectX 8.
> Capture Waves.

> runtime error when execute the next metod:
> "DSCBuffer.SetNotificationPositions"

> This code run ok in VB6, but runtime error in VB .NET.

> Public Sub CrearPuntosControl(ByRef Sender As frmPanel)
>     Dim psaPosicionBuffer() As DSBPOSITIONNOTIFY
>     Dim icontador As Integer
>     Dim NumeroEventos As Long

>     NumeroEventos = 20

>     ReDim psaPosicionBuffer(NumeroEventos)

>     BufferBytes = DSCTipoBuffer.lBufferBytes

>     'se introducen los puntos de notificacion en el array
>     For icontador = 0 To NumeroEventos
>         psaPosicionBuffer(icontador).hEventNotify = Dx.CreateEvent(Sender)
>         psaPosicionBuffer(icontador).lOffset = (bufferBytes/NumeroEventos)
*
> icontador
>     Next

>     'se establecen los puntos de notificacion
>     DSCBuffer.SetNotificationPositions(NumeroEventos, psaPosicionBuffer)
> '------> In this line runtime error.

> End Sub

> In spanish, the text error is:
> "Excepcin no controlada del tipo
> 'System.Runtime.InteropServices.COMException' en Audio2.exe
> Informacin adicional: No se ha encontrado el elemento."



Sat, 13 Nov 2004 20:41:41 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB.Net and DirectX 9: creating an event

2. VB.NET and DirectX

3. DirectX and VB.net problem, help!

4. DirectX and VB.Net

5. DirectX in VB.NET

6. DirectX with VB.NET

7. DirectX 8(.1) and VB.NET

8. vb.net Directx - InValidCastException with SetFont method

9. DirectX and VB.Net ?

10. directx and vb.net

11. DirectX 8 with VB.NET

12. VB.Net and DirectX 8.1?

 

 
Powered by phpBB® Forum Software