Click here to Skip to main content
15,892,746 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: VB.NET Global Event Pin
Purple Monk14-Jul-05 23:45
Purple Monk14-Jul-05 23:45 
GeneralRe: VB.NET Global Event Pin
Dave Kreskowiak15-Jul-05 1:37
mveDave Kreskowiak15-Jul-05 1:37 
GeneralVB6 to VB.NET Marshal Structure Pin
meyerengineering14-Jul-05 4:53
meyerengineering14-Jul-05 4:53 
GeneralRe: VB6 to VB.NET Marshal Structure Pin
Dave Kreskowiak14-Jul-05 5:51
mveDave Kreskowiak14-Jul-05 5:51 
GeneralRe: VB6 to VB.NET Marshal Structure Pin
meyerengineering14-Jul-05 6:31
meyerengineering14-Jul-05 6:31 
GeneralRe: VB6 to VB.NET Marshal Structure Pin
Dave Kreskowiak14-Jul-05 6:44
mveDave Kreskowiak14-Jul-05 6:44 
GeneralRe: VB6 to VB.NET Marshal Structure Pin
meyerengineering14-Jul-05 8:06
meyerengineering14-Jul-05 8:06 
GeneralRe: VB6 to VB.NET Marshal Structure Pin
meyerengineering15-Jul-05 4:16
meyerengineering15-Jul-05 4:16 
Thanks ProgLoad!

This is the cure.


*****************************************************************
Const HEIAPIVersion As Byte = 3
Const HEIT_WINSOCK As Short = 4
Const HEIT_IP As Short = 3
Const MAXDEVICES As Short = 100

Dim DeviceCount As Integer
Dim RC As Integer

Dim TP As HEITransport
Dim aDevices(MAXDEVICES) As HEIDevice


<StructLayout(LayoutKind.Sequential)> _
Private Structure HEITransport
Dim Transport As Short
Dim Protocol As Short
Dim Encrypt As Encryption
Dim SourceAddress As EnetAddress
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=47)> _
Dim Reserved() As Byte
End Structure

<StructLayout(LayoutKind.Sequential)> _
Private Structure HEIDevice
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=125)> _
Dim Address() As Byte
End Structure

<StructLayout(LayoutKind.Sequential)> _
Private Structure Encryption
Dim Algorithm As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> _
Dim Unused1() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=59)> _
Dim Key() As Byte '(null terminated)
End Structure

<StructLayout(LayoutKind.Sequential)> _
Private Structure EnetAddress
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=19)> _
Dim Address() As Byte
End Structure

Private Declare Function PASCAL_HEIOpen Lib "hei_pas" ( _
ByVal HEIAPIVersion As Short _
) As Integer

Private Declare Function PASCAL_HEIClose Lib "hei_pas" ( _
) As Integer

Private Declare Function PASCAL_HEIOpenTransport Lib "hei_pas" ( _
ByRef pTransport As HEITransport, _
ByVal HEIAPIVersion As Short, _
ByVal EnetAdress As Integer _
) As Integer

Private Declare Function PASCAL_HEICloseTransport Lib "hei_pas" ( _
ByRef pTransport As HEITransport _
) As Integer

Private Declare Function PASCAL_HEIQueryDevices Lib "hei_pas" ( _
ByRef pTransport As HEITransport, _
ByRef pDevice As HEIDevice, _
ByRef pNumDevices As Integer, _
ByVal HEIAPIVersion As Short _
) As Integer

'same as INIT button on full application
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
RC = PASCAL_HEIOpen(HEIAPIVersion)

TP.Transport = HEIT_WINSOCK
TP.Protocol = HEIT_IP

RC = PASCAL_HEIOpenTransport(TP, HEIAPIVersion, 0)
End Sub

'same as SCAN button on full application
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
DeviceCount = MAXDEVICES

'********************************************************************************
' this is the problem call
' TP and aDevices() I think need to be marshaled
'********************************************************************************
RC = PASCAL_HEIQueryDevices(TP, aDevices(0), DeviceCount, HEIAPIVersion)

End Sub





meyer
meyer@meyerengineeering.net
GeneralRe: VB6 to VB.NET Marshal Structure Pin
progload15-Jul-05 5:25
progload15-Jul-05 5:25 
Generalopen email Pin
Ali el14-Jul-05 4:52
Ali el14-Jul-05 4:52 
GeneralRe: open email Pin
Dave Kreskowiak14-Jul-05 5:48
mveDave Kreskowiak14-Jul-05 5:48 
GeneralRe: open email Pin
Ali el15-Jul-05 6:22
Ali el15-Jul-05 6:22 
GeneralRe: open email Pin
Dave Kreskowiak15-Jul-05 11:45
mveDave Kreskowiak15-Jul-05 11:45 
GeneralRe: open email Pin
Ali el17-Jul-05 5:03
Ali el17-Jul-05 5:03 
GeneralProblem in Data Reports in VB 6.0 Pin
Birdy14-Jul-05 3:48
Birdy14-Jul-05 3:48 
GeneralRe: Problem in Data Reports in VB 6.0 Pin
rwestgraham14-Jul-05 11:23
rwestgraham14-Jul-05 11:23 
GeneralRe: Problem in Data Reports in VB 6.0 Pin
Birdy15-Jul-05 2:08
Birdy15-Jul-05 2:08 
Generalnahelp me in this printing problem-- nidhi s Pin
pnavkumar@yahoo.co.in14-Jul-05 1:16
susspnavkumar@yahoo.co.in14-Jul-05 1:16 
GeneralRe: nahelp me in this printing problem-- nidhi s Pin
Dave Kreskowiak14-Jul-05 3:31
mveDave Kreskowiak14-Jul-05 3:31 
GeneralRe: nahelp me in this printing problem-- nidhi s Pin
Member 211512814-Jul-05 3:53
Member 211512814-Jul-05 3:53 
GeneralRe: nahelp me in this printing problem-- nidhi s Pin
Dave Kreskowiak14-Jul-05 4:24
mveDave Kreskowiak14-Jul-05 4:24 
GeneralChange SQL Server startup account to SA Pin
Toms Edison14-Jul-05 0:46
Toms Edison14-Jul-05 0:46 
GeneralRe: Change SQL Server startup account to SA Pin
Dave Kreskowiak14-Jul-05 1:16
mveDave Kreskowiak14-Jul-05 1:16 
GeneralSelecting dropdown value automatically Pin
macca2414-Jul-05 0:44
macca2414-Jul-05 0:44 
GeneralRe: Selecting dropdown value automatically Pin
Gavin Jeffrey14-Jul-05 0:50
Gavin Jeffrey14-Jul-05 0:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.