How do you pass an array of string through an event in an Interop User Control to vb6
Question
I have a VB.net control that has an event:
Public Event PassNames(ByVal names() as String)
When the event triggered in VB6, I get the following error:
"Function or interface marked as restriced, or the function uses an Automation type not supported in Visual Basic"
Here is the event in VB6:
Private Sub IteropControl1_PassNames(ByVal names() As String)
MsgBox "I don't work"
End Sub
Is there a way to uses arrays with Interop User Controls?
Solution
I figured it out what I was doing wrong.
In my VB.net control, my event should be
Public Event PassNames(ByRef names() as String)
instead of
Public Event PassNames(ByVal names() as String)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow