1. Nel convertire i progetti da VB6 a VB.NET occhio ai tipi numerici, che non corrispondono; usa questa tabella di conversione:
codice:
Byte (Bit) VB6 VB.NET
1 (8) Byte Byte (System.Byte)
2 (16) Integer Short (System.Int16)
4 (32) Long Integer (System.Int32)
8 (64) n.d. Long (System.Int64)
2. Fai così:
codice:
Public Delegate GUI_STATE_CALLBACK (ByVal GuiStateCallbackCtx As Integer, _
ByVal GuiState As Integer, ByVal Response As Byte, _
ByVal Message As Integer, ByVal Progress As Byte, _
ByVal SampleBuffer As Integer)
Public Declare Function GUICallbacks Lib "PvFw.dll" ( _
ByVal ModuleHandle As System.IntPtr, ByVal GuiStreamingCallback As System.IntPtr _
ByVal GuiStreamingCallbackCtx As Integer, ByVal GuiStateCallback As GUI_STATE_CALLBACK _
ByRef GuiStateCallbackCtx As Integer) As Integer
'...
Dim ret As Integer
ret = GUICallbacks(myHandle, 0, IntPtr.Zero, AddressOf TuaProcedura, 0)
'...
Public Function TuaProcedura (ByVal GuiStateCallbackCtx As Integer, _
ByVal GuiState As Integer, ByVal Response As Byte, _
ByVal Message As Integer, ByVal Progress As Byte, _
ByVal SampleBuffer As Integer)
'...
End Function
Probabilmente anche GuiStreamingCallback è un puntatore a funzione; se intendi utilizzarlo devi creare un delegate anche per lui.