Now I'm upgrading my old proyects to VB.NET but I Have the next problem's.

1.-
How replace VarPtr on a Win32 function, for example in a audio proyect:

'In a Form
Dim Caps As WAVEINCAPS, Which As Long

For Which = 0 To waveInGetNumDevs - 1
ret = waveInGetDevCaps(Which, VarPtr(Caps), Len(Caps))
Next

'In a Module
Public Type WAVEINCAPS
ManufacturerID As Integer 'wMid
ProductID As Integer 'wPid
DriverVersion As Long 'MMVERSIONS vDriverVersion
ProductName(1 To 32) As Byte 'szPname[MAXPNAMELEN]
Formats As Long
Channels As Integer
Reserved As Integer
End Type

Declare Function waveInGetNumDevs Lib "winmm" () As Long

Declare Function waveInGetDevCaps Lib "winmm" Alias "waveInGetDevCapsA" _
(ByVal uDeviceID As Long, _
ByVal WaveInCapsPointer As Long, _
ByVal WaveInCapsStructSize As Long) As Long

2.- how replace AddressOf on a Win32 function, for example in a audio proyect.

'In a form
dim ret as Long

ret = waveInOpen(DevHandle, DevicesBox.ListIndex, format, AddressOf waveInProc, 0, CALLBACK_FUNCTION Or WAVE_MAPPED)

'In a Module

Sub waveInProc(ByVal hwi As Long, _
ByVal uMsg As Long, _
ByVal dwInstance As Long, _
ByRef hdr As WAVEHDR, _
ByVal dwParam2 As Long)


'code here ....

End Sub

I'm sorry for my poor English, but I Live in Chile (SouthAmerica) and my primitive language is Spanish.

thanks