Hi
I have created a simple COM Class in VB.Net containing a simple
structure and function:
Public Structure MyStruct
Dim Param1 As Byte
End Structure
Public Function ShowStruct(ByRef MyPassedStruct As MyStruct)
' Do nothing
End Function
In VB6, I want to call the .Net function and pass the structure.
Public Type MyStruct
Param1 As Byte
End Type
Private Sub Command1_Click()
Dim netCall as New netDll
Dim testStruct as MyStruct
testStruct.Param1 = 10
Call netCall.ShowStruct(testStruct)
End Sub
When I try and comple my VB app it gives me an error saying 'ByRef
Argument Mismatch'. What am I doing wrong?
I have managed to pass integers and strings ok, I'm just having a
problem with structures.
Thanks
Jon
TDC - 24 Mar 2008 14:41 GMT
VB doesn't know that the VB6 MyStruct you declared is compatible with
the .NET MyStruct you declared. It wants them to be of the eaxct same
type.
> Hi
>
[quoted text clipped - 35 lines]
> Thanks
> Jon