1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| Imports System.Runtime.InteropServices
Module Module1
Private Declare Function Create Lib "C:\Documents and Settings\guerini-grossc\My Documents\PointToPoint.dll" Alias "P2P_Create" () As Integer
Private Declare Function Clear Lib "C:\Documents and Settings\guerini-grossc\My Documents\PointToPoint.dll" Alias "P2P_Clear" (<MarshalAsAttribute(UnmanagedType.AsAny)> ByVal p2p_struct As Object) As Integer
Private Declare Function AddSegment Lib "C:\Documents and Settings\guerini-grossc\My Documents\PointToPoint.dll" Alias "P2P_AddSegment" (<MarshalAsAttribute(UnmanagedType.AsAny)> ByVal p2p_struct As Object, ByVal D As Double, ByVal Z As Double, ByVal impedanceModel As Integer) As Integer
Private Declare Function SetSourceHeight Lib "C:\Documents and Settings\guerini-grossc\My Documents\PointToPoint.dll" Alias "P2P_SetSourceHeight" (<MarshalAsAttribute(UnmanagedType.AsAny)> ByVal p2p_struct As Object, ByVal hSource As Double, ByVal delta_hs As Double) As Integer
Private Declare Function SetReceiverHeight Lib "C:\Documents and Settings\guerini-grossc\My Documents\PointToPoint.dll" Alias "P2P_SetReceiverHeight" (<MarshalAsAttribute(UnmanagedType.AsAny)> ByVal p2p_struct As Object, ByVal hRec As Double, ByVal delta_hRec As Double) As Integer
Private Declare Function GetResults Lib "C:\Documents and Settings\guerini-grossc\My Documents\PointToPoint.dll" Alias "P2P_GetResults" (<MarshalAsAttribute(UnmanagedType.AsAny)> ByVal p2p_struct As Object, ByVal att_dB As Double) As Integer
Private Declare Function Delete Lib "C:\Documents and Settings\guerini-grossc\My Documents\PointToPoint.dll" Alias "P2P_Delete" (<MarshalAsAttribute(UnmanagedType.AsAny)> ByVal p2p_struct As Object) As Integer
Sub Main()
Dim p2p As Integer
Dim att(0 To 27) As Double
p2p = Create()
Clear(p2p)
AddSegment(p2p, 10.0, 10.0, 1)
AddSegment(p2p, 14.0, -3.0, 5)
AddSegment(p2p, 50.0, -3.0, 4)
SetSourceHeight(p2p, 0.3, 0.0)
SetReceiverHeight(p2p, 5.0, 0.0)
'GetResults(p2p, att(0))
Delete(p2p)
Dim i As Integer
For i = 0 To att.GetUpperBound(0)
Console.WriteLine("att(" & i & ") = " & att(i))
Next i
Dim ligne As String = Console.In.ReadLine()
End Sub
End Module |
Partager