Click here to Skip to main content
15,914,943 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralValidating textbox value against a db Pin
spettiford14-Jul-05 8:12
spettiford14-Jul-05 8:12 
GeneralRe: Validating textbox value against a db Pin
Christian Graus14-Jul-05 11:28
protectorChristian Graus14-Jul-05 11:28 
GeneralRe: Validating textbox value against a db Pin
spettiford15-Jul-05 2:20
spettiford15-Jul-05 2:20 
GeneralRe: Validating textbox value against a db Pin
Dave Kreskowiak15-Jul-05 3:51
mveDave Kreskowiak15-Jul-05 3:51 
GeneralRe: Validating textbox value against a db Pin
spettiford15-Jul-05 4:20
spettiford15-Jul-05 4:20 
GeneralRe: Validating textbox value against a db Pin
spettiford15-Jul-05 5:07
spettiford15-Jul-05 5:07 
Generalmonitoring/manipulating packets Pin
buzzbusy14-Jul-05 5:55
buzzbusy14-Jul-05 5:55 
GeneralRe: monitoring/manipulating packets Pin
Dave Kreskowiak14-Jul-05 6:43
mveDave Kreskowiak14-Jul-05 6:43 
GeneralBackColor Pin
Brad Fackrell14-Jul-05 5:51
Brad Fackrell14-Jul-05 5:51 
GeneralRe: BackColor Pin
Dave Kreskowiak14-Jul-05 6:06
mveDave Kreskowiak14-Jul-05 6:06 
GeneralRe: BackColor Pin
Brad Fackrell14-Jul-05 7:20
Brad Fackrell14-Jul-05 7:20 
GeneralListBox Question Pin
Anonymous14-Jul-05 5:48
Anonymous14-Jul-05 5:48 
GeneralRe: ListBox Question Pin
Brad Fackrell14-Jul-05 5:56
Brad Fackrell14-Jul-05 5:56 
GeneralRe: ListBox Question Pin
Anonymous14-Jul-05 9:41
Anonymous14-Jul-05 9:41 
GeneralI could not load the data in CrystalReport Pin
Jeeva Jose14-Jul-05 5:40
Jeeva Jose14-Jul-05 5:40 
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 

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.