trying to send array from VC++.net to VB.net DLL

Announcements and discussion for PInvoke

Moderators: Luke Jefferson, Robert

trying to send array from VC++.net to VB.net DLL

Postby Pizza4Life » Tue Mar 18, 2008 9:11 pm

I am new to pinvoke and looking for a little COM help. Sending an array from VC++.Net to VB.Net (Visual Studio 2005, .Net Framework 2) seems to be especially complicated - is this something Pinvoke can help with ?

Currently, my function in the VB.Net DLL accepts a lot of Byte variables, which should be in an array, but to overcome the technical difficulty of calling the function from VC++.Net using an array I'm using many variables instead.

Can anyone point me in a direction for the solution ?


thankyou very much!!
Pizza4Life
 
Posts: 2
Joined: Tue Mar 18, 2008 9:01 pm

Postby Pizza4Life » Wed Mar 19, 2008 12:11 am

this is what I'm doing at the moment to overcome passing an array from VC++

Code: Select all
        Function smbADM1026BlockWrite(ByVal ChannelNumber As Byte, _
                                      ByVal BusID As Byte, _
                                      ByVal SlaveAddress As Byte, _
                                      ByVal ReadCount As Byte, _
                                      ByVal DataCount As Byte, _
                                      Optional ByRef DataBuffer1 As Byte = 0, _
                                      Optional ByRef DataBuffer2 As Byte = 0, _
                                      Optional ByRef DataBuffer3 As Byte = 0, _
                                      Optional ByRef DataBuffer4 As Byte = 0, _
                                      Optional ByRef DataBuffer5 As Byte = 0, _
                                      Optional ByRef DataBuffer6 As Byte = 0, _
                                      Optional ByRef DataBuffer7 As Byte = 0, _
                                      Optional ByRef DataBuffer8 As Byte = 0, _
                                      Optional ByRef DataBuffer9 As Byte = 0, _
                                      Optional ByRef DataBuffer10 As Byte = 0, _
                                      Optional ByRef DataBuffer11 As Byte = 0, _
                                      Optional ByRef DataBuffer12 As Byte = 0, _
                                      Optional ByRef DataBuffer13 As Byte = 0, _
                                      Optional ByRef DataBuffer14 As Byte = 0, _
                                      Optional ByRef DataBuffer15 As Byte = 0, _
                                      Optional ByRef DataBuffer16 As Byte = 0, _
                                      Optional ByRef DataBuffer17 As Byte = 0, _
                                      Optional ByRef DataBuffer18 As Byte = 0, _
                                      Optional ByRef DataBuffer19 As Byte = 0, _
                                      Optional ByRef DataBuffer20 As Byte = 0, _
                                      Optional ByRef DataBuffer21 As Byte = 0, _
                                      Optional ByRef DataBuffer22 As Byte = 0, _
                                      Optional ByRef DataBuffer23 As Byte = 0, _
                                      Optional ByRef DataBuffer24 As Byte = 0, _
                                      Optional ByRef DataBuffer25 As Byte = 0, _
                                      Optional ByRef DataBuffer26 As Byte = 0, _
                                      Optional ByRef DataBuffer27 As Byte = 0, _
                                      Optional ByRef DataBuffer28 As Byte = 0, _
                                      Optional ByRef DataBuffer29 As Byte = 0, _
                                      Optional ByRef DataBuffer30 As Byte = 0, _
                                      Optional ByRef DataBuffer31 As Byte = 0, _
                                      Optional ByRef DataBuffer32 As Byte = 0) _
                                      As Boolean Implements _SMBusIPMI.smbADM1026BlockWrite


        End Function


as you can see, it's very ugly !
Pizza4Life
 
Posts: 2
Joined: Tue Mar 18, 2008 9:01 pm


Return to PInvoke.Net

Who is online

Users browsing this forum: No registered users and 1 guest