First of all: I have just found a solution with using a .NET-Collection
instead of an array. I make the datatype of the collection available in VB
and work with this.
But here is the original try:
This is the Part of the the .Net Interop Class
....
public User GetUser()
{
Service1 s1 = new Service1();
User u = s1.GetUser("g");
return u;
}
public User[] GetUsers()
{
Service1 s1 = new Service1();
User[] us = s1.GetUsers("g");
return us;
}
.....
VB procedure:
Private Sub Befehl0_Click()
Dim wss As WsSample
Dim u As User
Dim us() As User
On Error GoTo Err_Proc
Set wss = New WsSample
'get User Objekt
Set u = wss.GetUser 'works fine
Debug.Print u.Name, u.Id
'get ArrayOfUsers
us = wss.GetUsers 'does not work
Exit_Proc:
Exit Sub
Err_Proc:
Debug.Print Err.Number, Err.Description
GoTo Exit_Proc
End Sub
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comschrieb
im Newsbeitrag news:%2****************@TK2MSFTNGP02.phx.gbl...
Torsten,
Can you show some of the attempts you are trying to make? You will
need
to show the method you are exporting to COM (as well as any attributes for
interop) and then you will have to show the call site as well.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Torsten Z" <A@B.COMwrote in message
news:OP**************@TK2MSFTNGP04.phx.gbl...
Hi,
I have tried several things to passing an array of objects or a Object
Collection from .NET to VB6 but I can't get it work. Passing one object
works fine, but more than one not. Has anybody a solution for that.