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

Visual Basic

 
GeneralVB.NET Global Event Pin
Purple Monk14-Jul-05 5:12
Purple Monk14-Jul-05 5:12 
GeneralRe: VB.NET Global Event Pin
Anonymous14-Jul-05 5:56
Anonymous14-Jul-05 5:56 
GeneralRe: VB.NET Global Event Pin
Anonymous14-Jul-05 6:00
Anonymous14-Jul-05 6:00 
GeneralRe: VB.NET Global Event Pin
Dave Kreskowiak14-Jul-05 6:04
mveDave Kreskowiak14-Jul-05 6:04 
GeneralRe: VB.NET Global Event Pin
Dave Kreskowiak14-Jul-05 6:02
mveDave Kreskowiak14-Jul-05 6:02 
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 
I am converting a working VB6 program to VB.net and am unable to
correctly pass these structures to the dll.

I think I have everything initialized correctly but am not sure.

Any help or comments on how to Marshal this data will be appreciated.



Dim TP As Transport
Dim aDevices(100) As Device

<StructLayout(LayoutKind.Sequential)> _
Private Structure Transport
Dim Encrypt As Encryption
Dim SourceAddress As EnetAddress
<VBFixedArray(47)> Dim Reserved() As Byte

Public Sub Initialize()
Encrypt.Initialize()
SourceAddress.Initialize()
ReDim Reserved(47)
End Sub
End Structure

<StructLayout(LayoutKind.Sequential)> _
Private Structure Device
<VBFixedArray(125)> Dim Address() As Byte

Public Sub Initialize()
ReDim Address(125)
End Sub
End Structure

<StructLayout(LayoutKind.Sequential)> _
Private Structure Encryption
Dim Algorithm As Byte
<VBFixedArray(2)> Dim Unused1() As Byte
<VBFixedArray(59)> Dim Key() As Byte '(null terminated)

Public Sub Initialize()
ReDim Unused1(2)
ReDim Key(59)
End Sub
End Structure


<StructLayout(LayoutKind.Sequential)> _
Private Structure EnetAddress
<VBFixedArray(19)> Dim Address() As Byte

Public Sub Initialize()
ReDim Address(19)
End Sub
End Structure

Private Declare Function PASCAL_QueryDevices Lib "hei_pas" _
(ByRef pTransport As Transport, _
ByRef pDevice As Device) As Integer


Private Sub foo()
Call TP.Initialize() 'update call

For i = 0 To 100
Call aDevices(i).Initialize()
Next

'*************THIS CALL FAILS*****************
RC = PASCAL_HEIQueryDevices(TP, aDevices(0))
'*********************************************
End Sub

meyer
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 
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 

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.